Skip to content

Commit

Permalink
Support optional session invalidation on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
neeg authored and fabpot committed Jul 23, 2015
1 parent fcefc53 commit 1a55ff8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Silex/Provider/SecurityServiceProvider.php
Expand Up @@ -510,7 +510,10 @@ public function register(Application $app)
isset($options['with_csrf']) && $options['with_csrf'] && isset($app['form.csrf_provider']) ? $app['form.csrf_provider'] : null
);

$listener->addHandler(new SessionLogoutHandler());
$invalidateSession = isset($options['invalidate_session']) ? $options['invalidate_session'] : true;
if (true === $invalidateSession) {
$listener->addHandler(new SessionLogoutHandler());
}

return $listener;
});
Expand Down

0 comments on commit 1a55ff8

Please sign in to comment.