RE: [PHP-DB] independent session data for multiple browser windows
| From: | Bastien Koert | Date: | Sat, 16 Feb 2008 01:08:12 +0000 |
| Subject: | RE: [PHP-DB] independent session data for multiple browser windows | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44606@lists.php.net to get a copy of this message | ||
That just sounds like such recipe for disaster. What about running multiple divs with each data set
in that 'window'? Then you could pass each datasets relevant ids along to keep thing
separate...
Another option could to create multiple [i]frames and do the same thing?
Bastien> To: php-db@lists.php.net> From: chas@opendoor.com> Date: Fri, 15 Feb 2008 15:00:36
Bastien> -0800> Subject: [PHP-DB] independent session data for multiple browser windows> >
Bastien> Greetings,> > I have a nearly-completed accounts/billing database using PHP and > MySQL,
Bastien> and was just informed that users will want to access the > database via multiple windows in one
Bastien> browser on the same machine, so > I'm looking for a way to have each browser window have its
Bastien> own set of > session data.> > I was initially using cookies, so I switched to propagating
Bastien> the > session name via the URL, and had each window using a unique session > name, but the
Bastien> DATA from each named session was written to the same > file on disk
Bastien> (/private/var/tmp/whatever).> > I noticed that the session data file name included the session
Bastien> id, so > I tried propagating the session id in the URL, and setting the > session id right
Bastien> before session_start() -- that resulted in two data > files on disk, but one session would
Bastien> occasionally write to the other > session's data file. At this point, this is the code
Bastien> I'm trying:> > if (!array_key_exists('SESSION_ID', $_REQUEST)) {>
Bastien> $_REQUEST['SESSION_ID'] = 'SESS'.uniqid('');> }>
Bastien> session_name($_REQUEST['SESSION_ID']);>
Bastien> session_id($_REQUEST['SESSION_ID']);> session_start();>
Bastien> output_add_rewrite_var('SESSION_ID',$_REQUEST['SESSION_ID']);> > In
Bastien> php.ini, I now have:> session.use_cookies = 0> session.use_only_cookies = 0>
Bastien> session.auto_start = 0> > Also, I'm on Mac OS X Tiger, and everyone's using Safari.
Bastien> PHP > 5.0.24a, MySQL 4.1.22> > Any suggestions on how to have unique session data for
Bastien> multiple > windows in the same browser on the same machine? Seems like it must > be doable,
Bastien> but I haven't figured it out yet. Thanks to whomever can > help.> > Charles
Bastien> Whitaker> Technical Staff> Open Door Networks>
_________________________________________________________________