Enable / Disable Cookie Based Login On User Request While Login

i have a login form where is a check box remember me checkbox i want to have cookie based login if he/she checks the remember me check box … if they do not check it then cookie based login will not be done…

i have used this code for cookie based login (remember me checked)


 Yii::app()->user->login($identity,0,true);

i have used this code for cookie based login should not happen (remember me unchecked)


Yii::app()->user->login($identity,0,false);																															  

check this URL for cookie based login

http://www.yiiframework.com/doc/guide/1.1/en/topics.auth#cookie-based-login

i have seen this…

there is no documents that describes how to deal with my (remember me) scenario where i can dynamically enable disable coocki based login…

but my question is that …

so i searched i find the solution which i have described in question but i dont know why it is not working for me…

so i want to ask you …

M i going on raight way …?

or wrong…?

is it possible to disable cookie login via passing third parameter false to yii::app()->user->login() method…


Yii::app()->user->login($identity,3600*24*7,false);