Answers to various technical questions on php programming, mysql, linux, and many more categories.
Home / Programming / php / php session id keeps changing on every reload - how can I fix this?
php session id keeps changing on every reload - how can I fix this?
Last updated: 07/03/2009
The symptom here is that every reload of a page, causes a new session id to be assigned. This of course, renders the session tracking useless, since the id keeps changing.
Make sure your "session_start()" call is at the top of your script. That means, before any include calls, variable assignments, etc. I just put it right after the opening "<?" to be safe.