I'm using a session variable to store login data. Locally, everything works smooth, it logs in nicely and doesn't log out inbetween pages.
But when I put the same files on the server, for some reason I get logged out. I've already found this post, and tried using following code to prevent caching of dynamic pages:
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Though that doesn't seem to work. Are there any other possible solutions to this problem?
Edit: Note that session_start()
is on every page.
Edit 2: I did a little further investigation and it appears some of my links link to www.mysite.com
when on the mysite.com
. Going to this new page makes that the $_SESSION[]
vars aren't set, and when returning to the previous page with the back button you can see the $_SESSION[]
is still set.