I'm just creating a basic application in Laravel 4 and i have one small problem.
My logout function is not working properly... well it works, but:
When a user is signed in and clicks the logout button the user i getting logged out but when i click on the browsers Back-button im getting back to the logged in page.
I'm using the Auth::logout()
.
Does this method kill the session or does it have todo anything with the browsers cache?
How can i fix this?
My logout function:
public function getLogout(){
if(Auth::check()){
Auth::logout();
return Redirect::route('home');
}
}
My routes:
/*
* Authenticated users
*/
Route::group(array('before' => 'auth'), function() {
Route::get('success', array(
'as' => 'success',
'uses' => 'AccountController@getSuccess'
));
Route::get('signout', array(
'as' => 'signout',
'uses' => 'AccountController@getLogout'
));
});