Yii Framework Forum: Session Destory When Close browser - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Session Destory When Close browser

#1 User is offline   rrbala123 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 19-December 14

Posted 24 March 2015 - 01:52 AM

Hi,

How Session Destroy when User Closed browser?

How to Set Session Time?I want to set session destory 2 hours?how to set 2 hours ?
0

#2 User is offline   NIshant Goel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 24-March 15

Posted 24 March 2015 - 06:12 AM

PHP maintains a session in the browser window. So till the browser widndow remained opened session id is set in the session of ur browser. So as soon as browser windows is closed, PHP kills the session

You can set a session timeout using the YII, so that after the given time span, user will be automatically logged out.


'user' => array(
    'class' => 'WebUser',
    'loginUrl' => array('site/loginaccount'),
    'allowAutoLogin' => true,
    'authTimeout' => 1800
),

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users