title: Codeigniter session data not destroying until refresh the page
body: <p>I am trying to develop a registration system.</p>
  
  <pre><code>Registration Info -&gt; Subscription -&gt; Success page
  </code></pre>
  
  <p>While submitting the user information, I created a <code>session_data</code> and in the Success page <code>controller</code>, I unset the session so that the user cannot go back to the subscription page.</p>
  
  <p>The <code>subscription</code> and <code>success</code> controller is restricted if <code>session data</code> is not set.</p>
  
  <p><strong>Subscription Controller</strong> &amp; <strong>Success Controller</strong></p>
  
  <pre><code>public function __construct()
  {
      parent::__construct();
  
  
      if (! $this-&gt;session-&gt;userdata('st_guid'))
      {
          redirect('register');
      }
  }
  </code></pre>
  
  <p>And in <strong>Success Controller Index</strong> I unset the userdata.</p>
  
  <pre><code>public function index()
  {
  
      $this-&gt;load-&gt;view('success');
  
      // Unset session data
      $this-&gt;session-&gt;unset_userdata('st_guid');
      $this-&gt;session-&gt;sess_destroy();
  }
  </code></pre>
  
  <p>Problem is, if I click the browser back button it easily load the <code>subscription</code> page and click the forward button it loads the <code>success</code> page while I already unset the session data. If I refresh the page only then the session data getting destroyed and redirected to <code>registration</code> page.</p>
  
  <p>What should I do ?</p>
  
  <p>I am using <code>Codeigniter 2.2.6</code></p>