Re: PHP 4.0 Bug #3827: synchronizing access to sessions

From: Date: Tue, 14 Mar 2000 14:25:47 +0000
Subject: Re: PHP 4.0 Bug #3827: synchronizing access to sessions
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-16791@lists.php.net to get a copy of this message
On Tue, Mar 14, 2000 at 03:01:36PM +0100, Pavel Kolesnikov wrote: > On Tue, 14 Mar 2000, Sascha Schumann wrote: > > > On Tue, Mar 14, 2000 at 12:35:30PM -0000, k@les.cz wrote: > > > From: k@les.cz > > > Operating system: RedHat Linux 6.1 (kernel 2.2.12) > > > PHP version: 4.0 Latest CVS (14/03/2000) > > > PHP Bug Type: Feature/Change Request > > > Bug description: synchronizing access to sessions > > > > > > If I have an applicatin divided into two frames, > > > they share the same session and one frame sometimes > > > overwrites session saved by another frame (it usually happens with netscape). > > > > > > Do you have any idea how to avoid this problem? > > > > > > I tried to lock the session file after session_start() > > > and release the lock before end of my script, but I'm > > > not sure if this is a good solution (and if it's, > > > maybe PHP could provide some function for session locking). > > > > > > Any ideas? > > > > What do you mean by overwrite? Do registered variables disappear? > > Yes, they dissapear. I think it can be caused by this sequence > of events: > > 1, frame1 reads session file > 2, frame2 reads session file > 3, both of them change some registered variables > 4, frame1 saves its changes into session file > 5, frame2 saves its changes into session file > 6, session file contains only variables saved by frame2 frame1 will lock the session file, thus blocking frame2 until frame1 has updated the session file. - Sascha

« previous php.dev (#16791) next »