TheInsider
Programmer
Hello,
I have a login page in which the user enters a user ID and password, if they match I store the user ID in a session variable, as follows:
Session("UserID"
= Request.Form("UserID"
All of my pages check to see if the user is logged in before displaying them. I place the following at the very top of these pages:
If Session("UserID"
= "" Then
Response.Redirect " Response.End
End If
This works fine the first time the page is called, however, if the page is called again, the test returns true -- Session("UserID"
= "" -- even though the user is still logged in and the session has not timed out.
For example:
1) User logs in on Page A
2) User then goes to Page B, at this point Session("UserID"
is not = ""
3) Page B submits to Page C
4) Page C processes the data from Page B, then redirects the user back to Page B
5) Session("UserID"
= "" in Page B, because of this; user is unexpectedly redirected to default.asp
I have tried appending the date as a querystring to the end of the redirect link, to avoid caching problems, but this doesn't correct the problem. i.e.
in Page C:
Response.Redirect " & Server.URLEncode(Now)
Has anyone encountered this, and if so, how do I resolve this?
Thanks
I have a login page in which the user enters a user ID and password, if they match I store the user ID in a session variable, as follows:
Session("UserID"
All of my pages check to see if the user is logged in before displaying them. I place the following at the very top of these pages:
If Session("UserID"
Response.Redirect " Response.End
End If
This works fine the first time the page is called, however, if the page is called again, the test returns true -- Session("UserID"
For example:
1) User logs in on Page A
2) User then goes to Page B, at this point Session("UserID"
3) Page B submits to Page C
4) Page C processes the data from Page B, then redirects the user back to Page B
5) Session("UserID"
I have tried appending the date as a querystring to the end of the redirect link, to avoid caching problems, but this doesn't correct the problem. i.e.
in Page C:
Response.Redirect " & Server.URLEncode(Now)
Has anyone encountered this, and if so, how do I resolve this?
Thanks