title: Adding to cart in Codeigniter shopping cart class
body: <p>thanks for taking the time to read this. Ive been using the shopping cart class from code igniter for a basic cart, but im having one small issue. After adding an item to a cart I redirect the user to a checkout page, but when I click back on the browser the item gets removed. I know this because I have <code>&lt;?php echo anchor('cart','&lt;strong&gt;'.$this-&gt;cart-&gt;total_items(). '&lt;/strong&gt; item(s)') ?&gt;</code> in the header, and it decrements when going back. This is really annoying and I would like to fix it.</p>
  
  <p>this is the controller that process the form</p>
  
  <pre><code>public function process () {
  if($this-&gt;input-&gt;post('submit')) {
      $product = $this-&gt;products_model-&gt;getProductRow($this-&gt;input-&gt;post('productid'));
  
      $data = array(
      'id'      =&gt; $product['id'],
      'qty'     =&gt; 1,
      'price'   =&gt; $this-&gt;product_helper-&gt;calcPrice($product['id']),
      'name'    =&gt; $product['name']
      );
  
      $this-&gt;cart-&gt;insert($data);
      redirect('cart');
      //have tried using redirect('cart', 303); but doest do anything
      //have also tried flusing the buffer
  }           
  else
      redirect('seatcovers');}
  </code></pre>
  
  <p>Is there something trivial I am missing here, or is this something that needs to be changed within the cart class of CI?</p>
  
  <p>Many thanks</p>