sess_expire_on_close not working

前端 未结 3 1771
我寻月下人不归
我寻月下人不归 2021-01-13 22:22

I have a problem..in $config[\'sess_expire_on_close\'] = TRUE; when i close the browser..the session still save in the database. and i can still see the data

3条回答
  •  终归单人心
    2021-01-13 22:51

    The session closing will not erase the data in the database. It basically sets the value for session cookie lifetime to 0, meaning that the browser will delete the cookie when it closes (forcing a new session). The entry in the database table will not be cleaned up until garbage collection gets it, as, by default, there is no way for the browser to make a "callback" to the server to notify that it is closing so as to delete the session record in DB.

    For your purposes, you may want to define active users as users with records in DB less than your session lifetime in age.

提交回复
热议问题