Destroy the session when you call the logout function. Just write your exit function to your controller as follows:
public function getLogout() { Sentry::logout(); Session::flush();
Edit:
At first I used only Session: flush (), and somehow it worked! But when I checked again, I found that it was not working. So, we need to add another code to clear the browser cache upon logout.
Using a filter may be the solution to this problem. (I have not found another solution yet). First add this code to filters.php:
Route::filter('no-cache',function($route, $request, $response){ $response->header("Cache-Control","no-cache,no-store, must-revalidate"); $response->header("Pragma", "no-cache");
Then attach this filter to routes or controllers. I bound it to the controller build function as follows:
public function __construct() { $this->beforeFilter('csrf',array('on' => 'post')); $this->afterFilter("no-cache", ["only"=>"getDashboard"]); }
source share