Re: [PHP] A problem about sessions
Stuart Dallas ha scritto: >On 8 Jun 2012, at 00:39, Tazio Ceri wrote: > >> I have a PHP script that takes very long time to execute. I manage it >using the following structure: >> >> ob_start(); >> >> // some code >> session_start(); >> // some code >> >> header("Content-length: ".ob_get_length()); >> ob_end_flush(); >> >> // some other, very long, code! >> >> The problem I am facing is that, after having set up a session, often >I have error as >> I don't find any simple variable that I wrote in $_SESSION. >> Correct my if I am wrong, but I think that $_SESSION get saved to >disk only >> at the end of the script, after the "very long code" has been >executed. >> There is a way to save the session manually just after >ob_end_flush()? > > >http://php.net/session_write_close > >-Stuart > >-- >Stuart Dallas >3ft9 Ltd >http://3ft9.com/ >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Thank you, I don't know how I overlooked that function. Tazio Ceri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A problem about sessions
i can't undersans much of your question,, but i think you supposed to write the statement to set the variable's value after the "session_start()" called, like this ... session_start(); . some codes $_SESSION['some_var']; <--- don't put it before the session_start() On Thu, Jun 7, 2012 at 5:51 PM, Stuart Dallas wrote: > On 8 Jun 2012, at 00:39, Tazio Ceri wrote: > > > I have a PHP script that takes very long time to execute. I manage it > using the following structure: > > > > ob_start(); > > > > // some code > > session_start(); > > // some code > > > > header("Content-length: ".ob_get_length()); > > ob_end_flush(); > > > > // some other, very long, code! > > > > The problem I am facing is that, after having set up a session, often I > have error as > > I don't find any simple variable that I wrote in $_SESSION. > > Correct my if I am wrong, but I think that $_SESSION get saved to disk > only > > at the end of the script, after the "very long code" has been executed. > > There is a way to save the session manually just after ob_end_flush()? > > > http://php.net/session_write_close > > -Stuart > > -- > Stuart Dallas > 3ft9 Ltd > http://3ft9.com/ > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] A problem about sessions
On 8 Jun 2012, at 00:39, Tazio Ceri wrote: > I have a PHP script that takes very long time to execute. I manage it using > the following structure: > > ob_start(); > > // some code > session_start(); > // some code > > header("Content-length: ".ob_get_length()); > ob_end_flush(); > > // some other, very long, code! > > The problem I am facing is that, after having set up a session, often I have > error as > I don't find any simple variable that I wrote in $_SESSION. > Correct my if I am wrong, but I think that $_SESSION get saved to disk only > at the end of the script, after the "very long code" has been executed. > There is a way to save the session manually just after ob_end_flush()? http://php.net/session_write_close -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A problem about sessions
Hi all, I have a PHP script that takes very long time to execute. I manage it using the following structure: ob_start(); // some code session_start(); // some code header("Content-length: ".ob_get_length()); ob_end_flush(); // some other, very long, code! The problem I am facing is that, after having set up a session, often I have error as I don't find any simple variable that I wrote in $_SESSION. Correct my if I am wrong, but I think that $_SESSION get saved to disk only at the end of the script, after the "very long code" has been executed. There is a way to save the session manually just after ob_end_flush()? I can find a different solution, but I think it could be nice to have this working as is (if I am correct hunting this problem). Cheers, Tazio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php