In my project i used following way to store and fetch data from session.
To write data:
$this->Session->write('data', array('title'=>'Abc'));
To read data:
$this->Session->read('data')['title'];
And it is still working fine at live server. 2 days ago i shifted my code to some other live server. Now this server is showing fatal error at
$this->Session->read('data')['title'];
i.e unexpected [ ]
Then i google and found that there a some other way to get index e.g
$this->Session->read('data.title');
if $this->Session->read('data')['title']
is the wrong way then how it is still working at my old server.
Thanks in advance.