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
https://github.com/laravel/la...
这里有两个配置
lifetime = 120 ,控制过期时间,默认 120 分钟
expire_on_close = false,在关闭浏览器的时候,session 是否过期,默认是 false,默认是不过期,存在 lifetime 的时间,如果设置 expire_on_close = true,那么关闭浏览器session就会过期
其实看配置文件的英文就已经很好的解释了