Forum Moderators: open
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?
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.