getPageState not working as anticipated

I am using set/getPageState to transfer data between requests. What I have is actionIndex in which I define the state such as


$this->setPageState('type', $model['type']);

Then I have another actionNext in which I change the type with the exact same code above.

Once my form is rendered through actionIndex it is then submitted via ajax to actionNext without going though actionIndex again.

if I attempt to print


$this->getPageState('type');

in the index view I have no problems but if I print it in the actionNext nothing prints out so I am wondering why the getPageState works in the view but not in the controller/action level.

Any ideas?

Cheers,

bettor

Why not use Yii::app()->user->setFlash() / Yii::app()->user->getFlash() ?

Thanks for your reply twisted1919. The reason I don’t want to use set/getFlash is because I want it to be session independent.

I guess this isn’t really working with ajax bur rather only with POST requests