Ok, I found this on the web:
Question:
I call Session.Abandon after a person completes an order. The users session is expired and they have to relogin. Great! The issue is that the sessionID stays the same. From what I understand, this is suppose to change every time a new session is created. Is this true?
Answer:
Session.Abandon only releases the memory used by session variables and frees the server resources used by that session. Session ID is stored on the client side (as a cookie) and is unaffected by the Abandon method. As such, the session effectively restarts, but retains the session ID.
Sounds nice, but I need to know how to find out that the session has been abandoned in code. Ie, I have pages that look to see if there is a session active, if there is not, redirect to the login page. So i was hoping I could use:
but that doesn't work.
In my logout page i'm doing:
and was hoping that would be enough...
Can someone shed some light? I need to know how to tell if there session has ended.
Thanks.
Question:
I call Session.Abandon after a person completes an order. The users session is expired and they have to relogin. Great! The issue is that the sessionID stays the same. From what I understand, this is suppose to change every time a new session is created. Is this true?
Answer:
Session.Abandon only releases the memory used by session variables and frees the server resources used by that session. Session ID is stored on the client side (as a cookie) and is unaffected by the Abandon method. As such, the session effectively restarts, but retains the session ID.
Sounds nice, but I need to know how to find out that the session has been abandoned in code. Ie, I have pages that look to see if there is a session active, if there is not, redirect to the login page. So i was hoping I could use:
Code:
If (Session.SessionID = "") Then
but that doesn't work.
In my logout page i'm doing:
Code:
'delete cookies
Response.Cookies("MyCookie").Value = ""
'end session
Session.Abandon
and was hoping that would be enough...
Can someone shed some light? I need to know how to tell if there session has ended.
Thanks.