Skip to content

Instantly share code, notes, and snippets.

@quard8
Created December 10, 2012 09:30
Show Gist options
  • Select an option

  • Save quard8/4249587 to your computer and use it in GitHub Desktop.

Select an option

Save quard8/4249587 to your computer and use it in GitHub Desktop.
after middleware and cookie destroy
$app->get('/logout', function() use ($app) {
if ($app['session']->isStarted()) {
$app['session']->clear();
}
return $app->redirect("/");
})
->after(function(\Symfony\Component\HttpFoundation\Request $request,
\Symfony\Component\HttpFoundation\Response $response) use ($app) {
$response->headers->clearCookie($app['session']->getName());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment