Re: [PHP4BETA] session locking?
| From: | Sascha Schumann | Date: | Thu, 02 Dec 1999 22:53:53 +0000 |
| Subject: | Re: [PHP4BETA] session locking? | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7289@lists.php.net to get a copy of this message | ||
On Thu, Dec 02, 1999 at 11:09:35PM +0100, Boris Erdmann wrote:
> Hartmut Holzgraefe wrote:
> >
> > Is there any way to sync session usage between different script
> > instances ?
> >
> > What i am trying to do is to display a mail i fetched from a pop3
> > server.
> > Lets imagine a mail containing HTML text with two inlined images.
> >
> > script 1 fetches the entire message from the pop3 server and extracts
> > the different mime parts. theese are stored in session variables
> >
> > the IMG references in the HTML code get patched so that they now refer
> > to
> > script 2 and 3 which will generate the images from the data stored in
> > the
> > session
> >
> > but when the output of script 1 is transfered to the browser, the
> > browser
> > will send a request for the images as soon as the image tag is closed
> > so script 2 might get started even before script 1 has actually finished
> > and written back its session data ( see timeline below )
> >
> Yes,
>
> i second that. This is an issue when building sites with frameset pages, too.
I've thought about that as well, but did not consider the
asynchronous nature of generating web pages. Generally, you
can avoid this by calling
ob_start();
at the beginning of the page which starts the session (i.e.
the frameset-generating page).
We might add a session_sync() call which would save the
current state of the session without closing the session.
--
Regards,
Sascha Schumann
Consultant