title: Document Expired Back Browser Pressed When Searching in Codeigniter
body: <p>I have a program where i have searching code. When i do searching it will show a page with searching result. That page will display some content that can be click. When i click that content it will display me the detail of the product. From this detail page, when i clicked back in the browser it should be back to the search result page but i get document expired here. When i reload the page with document expired it will show the searching result again. I'm using codeigniter. I had try some code that i found but it still not working. That's my problem. Please help me. Thank you.</p>
  
  <p>Controller</p>
  
  <pre><code>public function search_bar($keyWordRestoran=NULL, $page=NULL, $orderBy=NULL)
          {
              if($this-&gt;session-&gt;userdata('logged_in'))
              {
                  $session_data = $this-&gt;session-&gt;userdata('logged_in');
                  $data['nama'] = $session_data['nama'];
                  $data['id'] = $session_data['id_user'];
                  $data['tipeUser'] = $session_data['tipe_user'];
  
              }
              else{
                  $data['nama'] = "";
                  $data['id'] = "0";
                  $data['tipeUser']="";
              }
              $data['url_image'] = $this-&gt;imageUrl;
              $keyWordRestoran_ip = $this-&gt;input-&gt;post('input-keyword');
              if($keyWordRestoran_ip=="")
              {
                  $session_data = $this-&gt;session-&gt;userdata('keyword_resto');
                  $keyWordRestoran = $session_data['keyword_resto'];
              }
              else{
                  $sess_array2 = array();
                  $sess_array2 = array(
                      'keyword_resto' =&gt; $keyWordRestoran_ip
                      );
                  $this-&gt;session-&gt;set_userdata('keyword_resto', $sess_array2);
                  $session_data = $this-&gt;session-&gt;userdata('keyword_resto');
                  $keyWordRestoran = $session_data['keyword_resto'];
              }
  
              $data['kunci_cari'] = $keyWordRestoran;
  
              $config['base_url'] = base_url().'/home_controller/search_bar/'.$keyWordRestoran;
  
              $data['jmlh_rows'] = $this-&gt;restoran-&gt;GetRestoran_search($keyWordRestoran);
  
              $total_row = $data['jmlh_rows']-&gt;num_rows();
  
              $config["total_rows"] = $total_row;
              $config["per_page"] = 8;
              $config['cur_tag_open'] = '&amp;nbsp;&lt;a class="current"&gt;';
              $config['cur_tag_close'] = '&lt;/a&gt;';
              $config['next_link'] = 'Next';
              $config['prev_link'] = 'Previous';
  
              $this-&gt;pagination-&gt;initialize($config);
  
              $str_links = $this-&gt;pagination-&gt;create_links();
              $data["links"] = explode('&amp;nbsp;',$str_links );
              $data["dataRestoran"] = $this-&gt;restoran-&gt;GetRestoranPerPage_search($config["per_page"], $keyWordRestoran, $page, $orderBy);
              $data['url_image'] = $this-&gt;imageUrl;
              $data['data_kategori'] = $this-&gt;jenismakanan-&gt;Getjenismakanan();
              $this-&gt;load-&gt;view('food-type_search', $data);
          }
  </code></pre>
  
  <p>Search View</p>
  
  <pre><code>&lt;div class="header-bottom"&gt;
      &lt;div class="col-xs-1"&gt;
          &lt;button class="toggle-button"&gt;&lt;/button&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-11"&gt;
      &lt;?php echo form_open('home_controller/search_bar');?&gt;
      &lt;div class="search"&gt;
      &lt;form method="GET"&gt;
          &lt;input type="text" id= "input-keyword" name="input-keyword" placeholder="Search ..." value="&lt;?php echo set_value('input-keyword')?&gt;" &gt;
          &lt;input type="submit" value=""&gt;  
      &lt;/form&gt;&lt;?php echo form_close(); ?&gt; 
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;div class="clearfix"&gt; &lt;/div&gt;
  </code></pre>
  
  <p></p>