即使关闭浏览器后,也可以保持会话状态吗? [英] Is possible to keep session even after the browser is closed?

查看:112
本文介绍了即使关闭浏览器后,也可以保持会话状态吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉如何维护会话(使用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提供非零的生存期,或设置

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.

这篇关于即使关闭浏览器后,也可以保持会话状态吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆