php - How to dynamically set the session to be deleted/retained when closing the browser in Laravel?
PHP中文网
PHP中文网 2017-05-31 10:34:32
0
1
815

As far as I know, session uses cookies to store a session id to authenticate login. When the cookie of session id is set to be stored in memory, it will disappear when the browser is closed. If the expiration time is set, it will be saved to Local, it will be deleted when the time is up.

The official documentation of Laravel only states that the configuration file can control this.

How can I set the expiration time of the session id in the code instead of in the configuration file (how long should it be stored locally on the client or stored in memory, and will be automatically deleted when the browser is closed)?

thank you all

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
滿天的星座

https://github.com/laravel/la...

There are two configurations here

  • lifetime = 120, control the expiration time, the default is 120 minutes

  • expire_on_close = false, when closing the browser, whether the session expires, the default is false, the default is not to expire, there is lifetime time, if expire_on_close = true is set, then the session will expire when the browser is closed

In fact, the English of the configuration file already explains it very well

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template