So, I've built a few sites with pretty generic login systems. It queries the database looking for the appropriate username, password and permission levels, then if it works, it assigns the information passed from POST into a SESSION variable or two.
But, if I go to a page that the browser has seen recently, it loses the SESSION variables and I have to log in again. But, upon the 2nd login, it works fine from that point on.
I thought it was an issue with caching pages so I put a script in to force it to look for new information every time a page is loaded, but that didn't help.
The very first thing that's written on any page that loads on these sites is session_start();.. so I don't think it's any sort of glitch or information loaded out of order. It just loses the data after the first login if I immediately go to a recently-seen page, then works from the 2nd login and never loses the information unless it expires.
I also tried to double it over with Cookies, creating cookies upon login and then reading the session information from a cookie from then on, but it does the same thing, even though the cookie exists and can be called properly.
Any ideas what might be wrong? Anybody ever encountered this?