Page 1 of 1

PHP session problems (Firefox shares sessions)!!

Posted: Tue Nov 28, 2006 1:30 pm
by mattward211
I'm running WinXP PHP 5.1.2 and Apache 2.0.59. My problem is when I pass sessions from one page to another. I have one page that has a single input box and a submit button. When you hit submit it assigns the post value to a session value as follows:
$_SESSION['userid'] = $_POST['id'];
Yes session_start() is on top of the page.
After this I have a link to another page that simply displays the session value like so
print $_SESSION['userid']. In IE6 and 7 everything works fine even with TWO windows open. I can type different values in the input box on the first window, submit it, and refresh the second window and the data doesn't change (what I want) think two different people logging in on the same PC with two different windows. I don't want the other to get the values.
However in FireFox with different windows open they "share" the values. So if I log in in the first window as a normal user, then open a second window log in as an admin, refresh the first window, I get the admin session info. in my case just a user id for right now.

Any ideas as to how to prevent this?? :twisted:

Posted: Tue Nov 28, 2006 4:28 pm
by feyd
Typically Internet Explorer will share the session data if the second window was created from the first. If you start it again it will often run under a separate process and not share data. I remember there being a setting for this behavior.

I don't recall if Firefox will do the same as I rarely have two windows open.