Hi everyone,
i have saved variables in session By default (Guest) by using the Yii::app()->user->setState(‘variable’=>“foo”).
then i want to make a login with $model->login().
if i want to do a login, the variables that are saved in session will be dissapeared ?
felagund18
(Felagund18)
January 11, 2012, 12:40pm
2
set "autoUpdateFlash=>false"
autoUpdateFlash
setting it false, which means flash message will be updated until its get.(bad english sorry)
set "autoUpdateFlash=>false"
autoUpdateFlash
setting it false, which means flash message will be updated until its get.(bad english sorry)
sorry but those are flash messages, i want to hold on the variavbles in session set by Yii::app()->user->setState() function, not that are set by Yii::app()->user->setFlash() function …
binkabir
(Binkabir)
January 18, 2012, 10:40am
4
your session setState is wrong
use this
Yii::app()->user->setState('variable','foo');
//to get the variable back
Yii::app()->user->getState('variable');
i’ve got the same problem and this solution doesn’t help.
Any suggestions?
thx
szfjozsef
(Szfjozsef)
June 15, 2012, 11:07pm
6
It seems to me too complicated…
Why don’t you simply store your data in $_SESSION ?
Additionally, play with setState ONLY when the user isn’t a Guest.