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->handle(2, 
'SessionHandler:...', 'D:\www\...', 548, Array)
#1 (...)\app\cache\dev\classes.php(548): 
SessionHandler->write('h1dtsg1umvntdna...', '_sf2_attributes...')
#2 [internal function]: 
Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('h1dtsg1umvntdna...',
 
'_sf2_attributes...')
#3 [internal function]: session_write_close()
#4 {main}
thrown in (...)\app\cache\dev\classes.php on line 548


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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to