Edit report at https://bugs.php.net/bug.php?id=63963&edit=1

 ID:                 63963
 Comment by:         jkm9000+php at gmail dot com
 Reported by:        jkm9000+php at gmail dot com
 Summary:            Session save does not always happen.
 Status:             Not a bug
 Type:               Bug
 Package:            Session related
 Operating System:   OSX/Linux
 PHP Version:        5.4.10
 Assigned To:        arpad
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for the clarification


Previous Comments:
------------------------------------------------------------------------
[2013-06-04 21:25:44] ar...@php.net

It's the same lack of writing the session before deciding the request is done.

Also added to the Symfony bug report:

Another thing to note is that object oriented session handlers rely on a 
shutdown function (if session_write_close hasn't been called) because of object 
dtors which might need the session.

------------------------------------------------------------------------
[2013-06-04 21:17:18] jkm9000+ph at gmail dot com

Why would this happen when using apache and mod_php though? That was the 
original 
environment it happened under.

------------------------------------------------------------------------
[2013-06-04 20:48:34] ar...@php.net

The issue is that fastcgi_finish_request() doesn't try to finish the session 
for that request, therefore the session isn't written until the (presumably 
long running) request is actually finished.

I think this behaviour is correct.

If you want to finish the session before this point, you can as Drak noted call 
session_write_close() explicitly.

------------------------------------------------------------------------
[2013-01-21 19:46:46] d...@php.net

It's been reported that calling session_write_close() before the  
fastcgi_finish_request(); call fixes it. Seems like a PHP bug. Reference: 
https://github.com/symfony/symfony/issues/6417#issuecomment-12513993

------------------------------------------------------------------------
[2013-01-11 00:01:02] jkm9000+php at gmail dot com

Sorry, originally tried with 5.4.4 and apache.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63963


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63963&edit=1

Reply via email to