Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Problem

Status
Not open for further replies.

shultz

Programmer
Oct 28, 2001
42
HK
<%Response.Buffer = True
' If the session has expired then force the user to re-login
Call checkSession

Function checkSession()
If NOT Session(&quot;loggedIn&quot;) = &quot;1&quot; Then
Response.Redirect(&quot;login.asp&quot;)
End If
End Function
%>

With the above statements, on every page, I check whether the session is still available or not. If it has expired then I force the user to re-login. For this I have a login screen which accepts the user name and password. Everything works fine. But on a couple of systems I encountered a problem where the session variables does not get registered. How can I ensure that the session variables are written to the client.

The client system has IE 5.5 installed. For that I selected Tools->Internet Options->Security->Local Intranet->Custom Level->Cookies->Allow cookies that are stored on your computer-Enable->Enable per session cookies(not stored)-Enable.

Is there an other way to do that.

thanks in advance.
 
Don't call the function, have it auto check on every page...just place the code like so, also change the syntax:

<%
If Session(&quot;loggedIn&quot;) <> &quot;1&quot; Then
Response.Redirect(&quot;login.asp&quot;)
End If
%>

This will check it at every page automatically and will also check to make sure the session doesn't equal 1. (<> = &quot;Is Not Equal To&quot;)

Hope this helps! -Ovatvvon :-Q
 
Hi Ovatvvon,

I tried the same thing as asked by you. But I'm encountering the same problem. Can you give me some other way. Or do you know how can I enable the cookies on the client system. Ofcourse,I do have access to other systems.
 
On the client machine, for session states, the way you have done it is the way to do it. The only other cookies are the ones that are stored on the client which have nothing to do with the session state.

How old are the browsers on those client machines? If they're pretty old, you may have to upgrade them. Otherwise if they're fairly new, and you have enabled the per-session cookies in the browser's themselves, I'm not sure what would be causeing the error unless it really doesn't have to do with the session state, but rather a client side problem which you run into on those machines only.(?)

If you've done those, I'm not sure.
-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top