Strange logout issue in Codeigniter
<p>To prevent caching in codeigniter, I am using </p>

<pre><code>&lt;?php
header('Expires: Sun, 01 Jan 1995 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');    
header('Pragma: no-cache');
?&gt;
</code></pre>

<p>In logout I unset the session data and destroy the session</p>

<pre><code>    $this-&gt;session-&gt;unset_userdata('logged_in');
    $this-&gt;session-&gt;unset_userdata('name');
    $this-&gt;session-&gt;sess_destroy();
    redirect('user/login');
</code></pre>

<p>When I press backbutton first time, only the login page comes up and not the other visited pages. So I assumed that no-cache is working.</p>

<p>But if I keep pressing the back button then confirm form re-submission page comes up and when i refresh the page, the home page shows up. The session data "name" is used for displaying user name and it displays as blank.</p>

<p>I use the below code on all controller functions to prevent access</p>

<pre><code>if(!$this-&gt;user-&gt;is_logged_in()) {
        redirect('user/login');
    }
</code></pre>

<p>The definition is in the model</p>

<pre><code>public function is_logged_in()
{
    return $this-&gt;session-&gt;userdata('logged_in') ? TRUE : FALSE;
}
</code></pre>

<p>Please guide me in resolving this issue. </p>