Session ID is being changed when I don't want it to
Posted: Thu Nov 02, 2006 5:11 am
Hey people,
I'm wondering if you could give me clues as to why my session ID changes on one page. I'll explain.
I've developed a CMS which stores the user's session ID upon successful login. All the admin pages have session_start(); at the top, and check that the current session ID still matches that in the database (hence keeping them logged in).
However, on one of my pages (print invoice page), the page will render fine, but when navigating to any other page, you'll be presented with the logon dialog again.
After a lot of testing, I found that this was due to the print invoice page changing the session ID once the page has been loaded, but what I don't understand is why.
session_start(); is called at the beginning of the script, so what could be going wrong?
Cheers,
Ed.
P.S. The following code is the print invoice page:
I'm wondering if you could give me clues as to why my session ID changes on one page. I'll explain.
I've developed a CMS which stores the user's session ID upon successful login. All the admin pages have session_start(); at the top, and check that the current session ID still matches that in the database (hence keeping them logged in).
However, on one of my pages (print invoice page), the page will render fine, but when navigating to any other page, you'll be presented with the logon dialog again.
After a lot of testing, I found that this was due to the print invoice page changing the session ID once the page has been loaded, but what I don't understand is why.
session_start(); is called at the beginning of the script, so what could be going wrong?
Cheers,
Ed.
P.S. The following code is the print invoice page:
Code: Select all
<? HIDDEN ?>