Multiple sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

Is there a way to have multiple sessions open in one browser (specifically, Firefox or Safari)? For example, IE does not transfer session data from one window to another, however, Firefox does. So, if one user opens a session and then his/her friend wants to open a different session of that same program on the same computer, (s)he is not able to without overwriting the first session data.

I have thought of one solution, but have yet to test it. Upon the first user logging in, I could assign them as session ID (along with the one that PHP creates). I could then verify that ID is being used on each page. For the second user, I could create a different one and do the same as the first. ????

<? // User 1
$_SESSION["my_special_id"] = abcd; // created upon logging in

if ($_SESSION["is_logged_in"] &&
    $_SESSION["my_special_id"] == $_GET["my_special_id"]) {
    // do stuff
}
?>

<? // User 2 in a different window of Firefox
$_SESSION["my_special_id"] = efgh; // created upon logging in

if ($_SESSION["is_logged_in"] &&
    $_SESSION["my_special_id"] == $_GET["my_special_id"]) {
    // do stuff
}
?>

Notice that they both share the same "is_logged_in" variable, but a different "my_special_id" variable. Actually, I just noticed something. If User 1 logs out and kills "is_logged_in", that would also kill it for User 2.

I don't know. I've confused myself now. Any suggestions? Common practices?

Thanks in advance,
~Philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux