# How To Response Json in Symfony Logout Controller

### Server Environment

Logout action can be performed by symfony2 security controller by default. when we give the path Logout like this it works fine. but I need to return some json format data in response to the javascript request.By default, it is a jump to the page to log out.

### Extend logout success handler

Now, whenever a user goes to the logout route, at the end of that request, Symfony will automatically log the user out and then redirect them… all after the controller is ever executed.

By the way, there are a few other things that you can customize under the logout section, like where to redirect. You can find those options in the Symfony reference section.