The same problem http://forumsarchive.laravel.io/viewtopic.php?id=9414
Now the issue is in the following scenario, Step 1: I visit login page, enter the credentials and submit. Step 2: I see the admin's home page. Now I click logout, I am redirected to login page. Step 3: I press back button of the browser, I am able to see the admin's home page.
How can I setup my own headers for route::group or all routs in application ?
I haven't done anything similar to what you are trying to do, but can't you just assign a filter iin your controller? Something like this
$this->beforeFilter('auth');
and in your filters.php
Route::filter('auth', function() {
if (Auth::guest()) {
return Redirect::guest('login');
}
});
There isn't much you can do about people hitting back. it will load more than likely a cached version. they wont be able to actually do anything because all actions will go to routes that hopefully have auth filter on them.
They aren't logged in, but they are seeing a cached version of the page.
This work for me:
App::after(function ($request, $response) {
/** @var $response Illuminate\Http\Response */
$response->header("Cache-Control", "no-cache,no-store, must-revalidate");
$response->header("Pragma", "no-cache");
$response->header("Expires", " Sat, 26 Jul 1997 05:00:00 GMT");
});
how to encrypt apis in laravel with x-www-form-urlencode format
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community