Re: Multiple Session Buffers
| From: | Richard Lynch | Date: | Sat, 14 Jul 2007 04:52:54 +0000 |
| Subject: | Re: Multiple Session Buffers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258842@lists.php.net to get a copy of this message | ||
On Fri, July 13, 2007 6:20 pm, Al wrote:
> Is there a way to instigate 2 separate named session buffers? They
> will contain different data.
I don't see how you could, since you'll be changing the contents of
$_SESSION which doesn't let you specify which of the two you are
messing with...
You could maybe do something like:
<?php
//session #1
session_set_cookie_params(...);
session_start();
//change $_SESSION
session_write_close();
//session #2
session_set_cookie_params(...);
session_start();
//change $_SESSION
session_write_close();
?>
But it's an awful lot of discipline to organize your code like that...
What might be easier would be to have a common session, but store all
the data sensibly so that the division is in $_SESSION data, rather
than actual separate sessions.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?