Catch session timeout Symfony2
I have a question about Symfony2 and I hope someone can help me out. Where does Symfony checks the users session and what to do is there is no session. Like redirect to the login page. I found some similar question, but not really what I mean. Why do I want to know it? If there is a session timeout. I want to check if the call is a XmlHttpRequest. If so, I want to return a JSON so the javascript can handle it. If notn do it the normal way. Thanks! you must create the listener Registering Event Listeners and Subscribers config.yml : services: mycompany.demobundle.listener.request: class: