Re: Multiple sessions
| From: | Tony Marston | Date: | Thu, 13 Jul 2006 08:04:35 +0000 |
| Subject: | Re: Multiple sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239459@lists.php.net to get a copy of this message | ||
I have found a way to allow multiple browser sessions regardless of which
browser is being used. Read about it at
http://www.tonymarston.net/php-mysql/client-clones.html
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
"Philip Thompson" <prthomp@uark.edu> wrote in message
news:A94DDF6C-459E-4870-AF2A-E828F4AF1F6C@uark.edu...
> 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