View Single Post
  #1 (permalink)  
Old 02-26-03, 21:07
hktang hktang is offline
Registered User
 
Join Date: Nov 2002
Location: Singapore
Posts: 17
Question Session Variables Lost

Hi people,

I have a problem with session variables lost while redirecting to other pages.
What the codes does is to ask the user to sign in. If success authenticate the user, member ID will be assign to the session. And the next page will do a check on member ID in session.


Sign-in page :
- The usual form asking for password and email


Login page :
<%
If Success Login Then
Session("memberID") = Member ID
Response.Redirect "Page 1"
Else
Response.Redirect "login.asp?mode=2"
End If
%>


Page 1 :
<%
If Session("memberID") = 0 Then
Response.Redirect "login.asp?mode=1"
End If
%>


So, page 1 simply enforce user to login before viewing its content. The problem here is, in login page, the member ID does exists in session. But while redirecting over to Page 1, the member ID is lost !


I have got a few facts over the web, which does not apply in my case.

1. There are no Session.abandon been called in anywhere. No way the session data can be cleared away.
2. My server is on a workgroup and has no invalid characters ( refer http://support.microsoft.com/default...b;EN-US;316112 for one of the possible caused of session not persist)
3. The value does exists and stay in session while I am in login.asp... it just never stay alive till the next page.
4. I have testing on a few different PC and the same problem occurs
5. I use no frame for the webpages ( refer http://support.microsoft.com/default...;en-us;q178037 - this is applicable to IE 4,5 only)
6. Yes, the browser is cookies enabled
7. The pages are tested locally, never go through any firewall (I have read somewhere that ASP session might lost while travelling through firewall)
8. Standard session timeout : 20 minutes

All the server I have tested is running Win2k Server, IIS5, IE6.


Any idea what went wrong? Please advise.

Thanks in advance.

Last edited by hktang; 02-26-03 at 21:18.
Reply With Quote