Hey,

It's a PHP issue introduced in 5.4 related to the SessionHandler. Symfony 
started using this interface in recent versions.

I've submitted a bug report for PHP : https://bugs.php.net/bug.php?id=63379 I 
was hoping to get around to creating a patch but I haven't managed to find the 
time yet.

A quick workaround if your security policy allows for it is to set 
"invalidate_session: false" in the "logout" handler of your firewall secured 
area in security.yml.

PS : Don't forget to add your vote to the bug report. It'll get fixed 
eventually ;)



________________________________
 De : Alfonso Machado <alfonso.mach...@ambitiona.com>
À : symfony-devs@googlegroups.com 
Envoyé le : Jeudi 15 novembre 2012 14h12
Objet : [symfony-devs] Re: [SF2.1] user logout - "SessionHandler::write(): 
Parent session handler is not open"
 

I have the same problem too, any solution?

El domingo, 22 de julio de 2012 18:27:40 UTC+2, Jacek Jędrzejewski  escribió:
So I'm making a project using Symfony 2.1 and today I encountered this error 
after performing a logout of my user:
>
>
>
>
>Fatal error:  Uncaught exception 'ErrorException' with message 'Warning: 
>SessionHandler::write(): Parent session handler is not open in 
>(...)\app\cache\dev\classes. php line 548' in 
(...)\app\cache\dev\classes. php:548
>Stack trace:
>#0 [internal function]: Symfony\Component\HttpKernel\ 
>Debug\ErrorHandler-&gt;handle( 2, 'SessionHandler:...', 'D:\www\...', 548, 
>Array)
>#1 (...)\app\cache\dev\classes. php(548): SessionHandler-&gt;write(' 
>h1dtsg1umvntdna...', '_sf2_attributes...')
>#2 [internal function]: Symfony\Component\ HttpFoundation\Session\ 
>Storage\Proxy\ SessionHandlerProxy-&gt;write( 'h1dtsg1umvntdna...', 
>'_sf2_attributes...')
>#3 [internal function]: session_write_close()
>#4 {main}
>thrown in (...)\app\cache\dev\classes. php on line548
>
>
>
>
>Little background for this: My project uses Ajax in many places and also login 
>and logout actions are executed with Ajax call. I created login 
>success/failure and logout success handlers which detect requests performed 
>with XmlHttpRequest and instead of normal Redirect Response they return JSON 
>status message. So in my case it looks like this:
>
>
>
>
>public function onLogoutSuccess(Request $request)
{ if ($request->isXmlHttpRequest()) { $result = array( 'type' => 'logout', 
'response' => 'success' ); $response = new Response(json_encode($result)) ; 
$response->headers->set(' Content-Type', 'application/json'); return $response; 
} else { $url = 'home'; return $this->httpUtils-> createRedirectResponse($ 
request, $url); }
}
>
>
>
>
>
>Everything worked just fine some days ago and today I updated vendors with 
>composer and tried to logout and received a response 
>{"type":"logout","response":" success"}with joined Fatal Error shown above. So 
>it must have been a change made in symfony not in my code because a couple of 
>days ago it was all fine. Is this a bug? Or am I doing something wrong right 
>now?
-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com
 
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to