On logout from my Laravel application using the Laravel logout method:
public function getLogout()
{
Auth::logout();
return Redirect::to(\
I tried with this and it works.
In routes:
Route::group(array('before' => 'auth', 'after' => 'no-cache'), function()
{
Route::get('dashboard', array('as' => 'getDashboard', 'uses' => 'DashboardController@getIndex'));
Route::get('logout', array('as' => 'getLogout', 'uses' => 'LoginController@getLogout'));
Route::group(array('prefix' => 'users'), function()
{
Route::get('users', array('as' => 'getUsers', 'uses' => 'UsersController@getIndex', 'before' => 'hasAccess:users.index'));
});
});
In filters:
Route::filter('no-cache',function($route, $request, $response){
$response->headers->set('Cache-Control','nocache, no-store, max-age=0, must-revalidate');
$response->headers->set('Pragma','no-cache');
$response->headers->set('Expires','Fri, 01 Jan 1990 00:00:00 GMT');
});