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

 ID:                 63963
 Comment by:         jkm9000+ph 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:

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


Previous Comments:
------------------------------------------------------------------------
[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.

------------------------------------------------------------------------
[2013-01-10 23:56:17] jkm9000+php at gmail dot com

Description:
------------
There is an issue open in the Symfony codebase that seems to actually be a 
problem 
with PHP. 

https://github.com/symfony/symfony/issues/6417#issuecomment-11878369

I was encouraged to open a ticket here and let Arpad know, but I don't see a 
way 
to do that here.

Basically when anything other than the default filesystem sessions are used I 
have 
a reproducible way where session data is lost. When I use the filesytem 
sessions 
with the same code, it works.

Originally I tried with 5.4.10 via apache / mod_php. The problem persists with 
5.4.10 under nginx/php-fpm.

Test script:
---------------
There is some code mention here - 
https://github.com/symfony/symfony/issues/6417#issuecomment-11878369

as well as where I opened my ticket originally - 
https://github.com/FriendsOfSymfony/FOSUserBundle/issues/921

Expected result:
----------------
The expected result would be the session data is present.

Actual result:
--------------
Session data is lost.


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



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

Reply via email to