I am developing a website with Yii.
I have a button in the page. I need to set a session variable when user clicks it and get the session value when user clicks on another button.
How can I do that?
I am developing a website with Yii.
I have a button in the page. I need to set a session variable when user clicks it and get the session value when user clicks on another button.
How can I do that?
Simple
Use
CWebUser
state methodsyou can use CWebUser's setState.
// get a session variable. The following usages are equivalent:
// set a session variable. The following usages are equivalent:
// remove a session variable. The following usages are equivalent:
// check if a session variable exists. The following usages are equivalent: