title: codeigniter - store post data in session and display in view
body: <p>I have a codeigniter form that users populate. on submission the inputs are posted to an array. this array is then displayed on the new view that is loaded as variables.</p>
  
  <p>My issue is that if I refresh the view for whatever reason, those posts are lost and the new view cant display the variables.</p>
  
  <p>How can I store the posted array as a session value and then how do I access the session variables.</p>
  
  <p>So my controller is:</p>
  
  <pre><code>function new_blank_order_lines() 
    {
      $data = array(
      'customer' =&gt;$this-&gt;input-&gt;post('customer'),
      'period' =&gt;$this-&gt;input-&gt;post('period'),
      'buom' =&gt;$this-&gt;input-&gt;post('buom')
         );
  
      $this-&gt;load-&gt;view('sales/new_blank_order_lines',$data);
    }
  </code></pre>
  
  <p>on <code>new_blank_order_lines</code> I can display the variables with <code>echo $customer</code></p>
  
  <p>now if I refresh the view <code>new_blank_order_lines</code>, the view is reloaded and the post variables lost. So I want to store the $data array as a session so it is available even after a page reload / refresh.</p>
  
  <p>Any advice?</p>
  
  <p>I am thinking something like:</p>
  
  <pre><code>    function new_blank_order_lines() 
        {
          $data = array(
          'customer' =&gt;$this-&gt;input-&gt;post('customer'),
          'period' =&gt;$this-&gt;input-&gt;post('period'),
          'buom' =&gt;$this-&gt;input-&gt;post('buom')
             );
  
          $this-&gt;session-&gt;$data
  
          $this-&gt;load-&gt;view('sales/new_blank_order_lines',$data);
        }
  </code></pre>
  
  <p>this obviously does not work? if it does work how do I echo out the value of the variable?</p>
  
  <p>Thanks as always,</p>