title: How to Assign an array value to session variable in zend framework
body: <p>I am trying to create a session variable and assign values in an array to this session variable. how can i do that.
  i am creating like below but i cannot get to it is functioning at all.</p>
  
  <pre><code>$post = Zend_Controller_Front::getInstance()-&gt;getRequest()-&gt;getParam('key');
  $searches = new Zend_Session_Namespace('searches');
  $parthis= $searches-&gt;partssearched;
  if(!is_array($parthis)){
      $parthis-&gt;toArray();
      $parthis[0]=$post;
  } else {
  
  $count= sizeof($parthis)."&lt;br&gt;";
  if ($this-&gt;rows ) {
      if ($count==0) {$parthis[0]=$post;}
      //$searches[$count]=$this-&gt;rows;
      echo $parthis[0]."HERE";
  } else {
      $parthis[$count]=$post;
      foreach($parthis as $hist) {
          echo $hist;
      }
  
  }
  }
  </code></pre>
  
  <p><code>$this-&gt;rows</code> are coming from the controller and it is carrying database query results. </p>
  
  <p>What i am trying to do here is i want to store the Get value into a session variable carrying it as an array.</p>
  
  <p>Should be like <code>$parthis= array (value1, value2, value3);</code>
  and every time user pass a value in url, it should add upto it.</p>
  
  <p>Thank you</p>