title: Array in session variable (Yii)
body: <p>I'm trying to accomplish function that adds values to a session variable, which is array, every time user visits certain page. Here's my code from controller:</p>
  
  <pre><code>public function actionPut($id)
      {
          $session=new CHttpSession;
          $session-&gt;open();
          if (empty($session['the_variable'])) {
              $session['the_variable'] = array($id);
          }
          else {
              $session['the_variable'][] = $id;
          }
          $session-&gt;close();
          $this-&gt;render('test', array('session'=&gt;$session));
      }
  </code></pre>
  
  <p>But it doesn't work. If the variable is empty, it only stores information for the first time. Next time i visit the page it doesn't add value to an array.
  I've also tried <code>push_array</code> function, but no luck.
  What is wrong?</p>