Forum Moderators: open

Message Too Old, No Replies

Session Variables Dissappear

Session variables seem to clear intermittently

         

jobremski

7:55 pm on Oct 20, 2004 (gmt 0)

10+ Year Member



I've used session variables before and when I set them they ususally stay set until either the timout expires or I set it with another value.

On a new website I'm developing I have alogin page that once you login it sets userID. I can then pull this value from page to page whenever I need to know who is logged in. On the top of each page I check to make sure userID is not blank, if it is, your not logged in or your session expired.

Intermittently it seems this value is going blank without reason. Some times it will go for a while and other times it blanks out immediatly. Any ideas?

txbakers

8:35 pm on Oct 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can only think of two times when I've seen this before:

1) Somewhere you are inadvertently setting the value for UserID again, perhaps by using an assignment token rather than a comparitive ( = vs. == in Java)

2) The cookies that hold the session variable are not being written to the local client machine, but instead are being written to a central store and are being overwritten.

I once did a training on a web based app where the training room cookies were all being routed to one location. It was a royal mess. Everyone logged in with their own ID and were pulling up pages from other users in the room!

Welcome to the Webmaster World! Glad to see your first post.

jobremski

9:10 pm on Oct 20, 2004 (gmt 0)

10+ Year Member



I think it was the cookie issue, I was playing with Security settings in IE and after trying a few it seemed "Medium" allowed the session variables to stay without randomly disapearing. Need to do some more testing but looks promising so far.