In my application made with Silex, if I go to the address "/logout", I leave my admin panel and go to my login form. However, if I press the back button on the browser, I go back to the previous interface. Although the session is already disabled and when you touch something you are redirected to /login.
This is my security settings:
$app['security.firewalls'] = array(
'admin' => array(
'pattern' => '^.*$',
'form' => array(
'login_path' => '/auth/login',
'check_path' => '/login_check',
'always_use_default_target_path' => true,
'default_target_path' => '/auth/redirect/'
),
'anonymous' => true,
'logout' => array(
'logout_path' => '/auth/logout',
'target_url' => '/auth/login',
'invalidate_session' => true
),
'remember_me' => array(
'key' => $app['remember_me_key'],
'lifetime' => $app['remember_me_lifetime'],
'remember_me_parameter' => '_remember_me'
),
'users' => $app->share(function () use ($app) {
return new User\UserProvider($app);
}),
),
How I can control that when you try to go back, if the session is over, you will be redirected to the login form?
Edit
I thought about adding the following headers:
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/html');
But how I can add this, or something similar, to the template login.twig?