即使关闭浏览器后,也可以保持会话状态吗?

编程入门 行业动态 更新时间:2024-10-21 09:34:30
本文介绍了即使关闭浏览器后,也可以保持会话状态吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

任何人都可以告诉如何维护会话(使用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.

更多推荐

即使关闭浏览器后,也可以保持会话状态吗?

本文发布于:2023-11-27 08:27:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637279.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:关闭浏览器   状态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!