How To clear cache after logout In Laravel
<p>Its a common problem . When I logout and then click on the browser back button the browser shows the last loaded page from the website .</p>

<p>I have went through lots of links on stack most of them suggest to clear the headers on logout but it didn't worked .</p>

<p>here is the code that I have tried </p>

<pre><code>Route::get('main/logout',function(){


 Session::flush();
 Auth::logout();
 header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
 header("Pragma: no-cache"); // HTTP 1.0.
 header("Expires: 0"); // Proxies.
 session()-&gt;flash('alert-success', 'Success logged out');
 return Redirect::to('/');
}); 
</code></pre>

<p><strong>Update</strong></p>

<p>I also tried to add this in my APP.blade.php file in the header</p>

<pre><code>&lt;meta http-equiv="cache-control" content="max-age=0" /&gt;
&lt;meta http-equiv="cache-control" content="no-cache" /&gt;
&lt;meta http-equiv="cache-control" content="no-store" /&gt;
&lt;meta http-equiv="cache-control" content="must-revalidate" /&gt;
&lt;meta http-equiv="expires" content="0" /&gt;
&lt;meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /&gt;
&lt;meta http-equiv="pragma" content="no-cache" /&gt;
</code></pre>

<p>If any of you have any IDEA please let me know</p>

<p>Thanks </p>