This is the code of my first page:
public function actionTest()
{
echo "<a href='test2'>Test</a>";
$test = Yii::app()->user->getState('my123test');
echo "<pre>".print_r($test,true)."</pre>";
}
In the second page:
public function actionTest2()
{
Yii::app()->user->setState('my123test', array("omg" => time()));
}
After clicking “Test” in the first page, I click back button on my browser (I’m using newest chrome). It should be showing timestamp at the first page, but it’s not. It shows the timestamp when I refresh the first page. When I’m testing the code in another apache server, the first page does show a timestamp without refreshing. So my question is why CWebUser::getState return nothing when using back button in some apache servers? Thanks in advance.