I am new to Laravel 5 and trying to make a simple authentication page. My problem is i can logout properly after i click to logout link but if i click to back button of the
Yeah its just a browser behavior, not any issue from laravel side but this could be a security issue. Here is how i solved it,
php artisan make: middleware PreventBackHistory
$response = $next($request); $response->headers->set('Cache-Control','nocache, no-store, max-age=0, must-revalidate'); $response->headers->set('Pragma','no-cache'); $response->headers->set('Expires','Sun, 02 Jan 1990 00:00:00 GMT'); return $response;
'prevent-back-history' => \App\Http\Middleware\PreventBackHistory::class
Route::group(['middleware' => ['prevent-back-history','otherMiddlewares']]
It will work for you!