sess_expire_on_close not working

前端 未结 3 1793
我寻月下人不归
我寻月下人不归 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 23:00

    The server never knows about the user closing their browser. 'sess_expire_on_close' regards whether the user's cookie will be written and re-used when the browser is restarted.

    To detect and end session, you'd have to perform a check like outlined in this question: javascript detect browser close tab/close browser

    and then perform

    $this->session->sess_destroy();
    

    in codeigniter.

提交回复
热议问题