Hi every one;
how to i setting session in YII , when user close the Browser the session related to that user cleaned?
i setting session to be saved in my project.
'session'=>array('autoStart'=>true, 'savePath'=>$path )
please help me .Thanks
Gregurco
(Gregurco Vlad)
August 28, 2014, 12:17pm
2
I can’t find any solution in this Topic …!
Please help me clearly.
Gregurco
(Gregurco Vlad)
August 28, 2014, 1:08pm
4
'session'=>array('autoStart'=>true, 'savePath'=>$path )
to
'session' => array('class' => 'CDbHttpSession', 'autoStart'=>true, 'savePath'=>$path, 'timeout' => 0)
Gregurco:
'session'=>array('autoStart'=>true, 'savePath'=>$path )
to
'session' => array('class' => 'CDbHttpSession', 'autoStart'=>true, 'savePath'=>$path, 'timeout' => 0)
Thanks for Your try. but session file not be created; and i not have session in my other web page.and i have session for a moment.
please help me?
Gregurco
(Gregurco Vlad)
August 28, 2014, 1:38pm
6
Hmmm. Then you should use cookies instead of session. Becouse session can’t be destroyed when user closes browser.
Gregurco
(Gregurco Vlad)
August 28, 2014, 1:40pm
7
'allowAutoLogin'=>true,
and
Yii::app()->user->login($identity, 0);
no no the data that be saved in session is important.not safe if i save them into client side.
Gregurco
(Gregurco Vlad)
August 28, 2014, 1:53pm
9
It’s impossible. Becouse you can’t check on your server if user closed browser. Read about sessions and cookies. Cookies can be safe.
But cookie be save in user side.it can be accessible ;
Thank you .
Gregurco
(Gregurco Vlad)
August 28, 2014, 2:10pm
11
For example: create some token (some radom encoded string) and save it in cookie of user and in DB. And I think it will be hard to guess this random string and to fake the authorization.
alirz23
(Alirz23)
August 31, 2014, 5:10am
13
right here
'class' => 'CDbHttpSession',
it says store the sessions in database thats why you can’t find the session file
alirz23:
right here
'class' => 'CDbHttpSession',
it says store the sessions in database thats why you can’t find the session file
Thanks for reply.but i don’t save them in DB and that work…???