[PHP] Multiple Session Buffers

2007-07-13 Thread Al

Is there a way to instigate 2 separate named session buffers? They will contain 
different data.

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



Re: [PHP] Multiple Session Buffers

2007-07-13 Thread Richard Lynch
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?

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