Why Session Variables Are Not Working On Other Contoller

Hello, Iam tring to set some data in session





        $datasession=new CHttpSession;

        $datasession['products']=$products;// 2 d array 

        $datasession['page']='Preview';// this is in one of the view of mm controller    

// after redirecting it to another contoller name check and calling it like


 $datasession= new CHttpSession;

 echo $datasession->count();//gives error



PHP notice

Undefined variable: _SESSION

D:\local server\www\appli\framework\web\CHttpSession.php(434)




422      */

423     public function getIterator()

424     {

425         return new CHttpSessionIterator;

426     }

427 

428     /**

429      * Returns the number of items in the session.

430      * @return integer the number of session variables

431      */

432     public function getCount()

433     {

434         return count($_SESSION);

435     }



what to do?????

You’re missing a call to CHttpSession.open().