Re: PHP 4.0 Bug #3827: synchronizing access to sessions
| From: | Pavel Kolesnikov | Date: | Tue, 14 Mar 2000 14:01:36 +0000 |
| Subject: | Re: PHP 4.0 Bug #3827: synchronizing access to sessions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16787@lists.php.net to get a copy of this message | ||
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
Of course I may be wrong, only what I know is that if two
frames share one session, then variables registered by
first frame sometimes dissapead. This happens often
with netscape browser, I've never seen this problem
with MSIE.
Pavel