任何人都可以告诉如何维护会话(使用PHP),以便即使重新启动浏览器后也可以保留会话中包含的内容并对其进行访问.
Could anyone tell how to maintain a session (in PHP) so that the session contains are preserved and are accessible even after the browser is restarted.
通常,会话会随着浏览器的关闭而过期,但是我希望不要关闭该会话,以便下次使用浏览器时可以访问该会话数据.
In general a session expires with the closing of a browser, but I want the session NOT TO BE CLOSED so that the session data's can be accessed the next time the browser is used.
推荐答案使用 session_set_cookie_parameters() ,以在开始会话之前为会话cookie提供非零的生存期,或设置 session.cookie_lifetime 设置为非零.
Use session_set_cookie_parameters() to give the session cookie a non-zero lifetime before starting the session, or set session.cookie_lifetime to non-zero.
更多推荐
即使关闭浏览器后,也可以保持会话状态吗?
发布评论