[英]Clear session on browser close-Native session
I am using native session library in my codeigniter project.I want to destroy the session when browser close.is there any method for that? 我在我的codeigniter项目中使用本机会话库。我想在浏览器关闭时销毁会话。有什么方法吗? In default session library
sess_expire_on_close
is there ,But in native session that setting is not there.I notice that native session is using PHPSESSID
for the session.is any way to delete PHPSESSID
from browser,when browser close? 在默认会话库中,有
sess_expire_on_close
,但是在本机会话中不存在该设置。我注意到本机会话正在使用PHPSESSID
作为该会话。当浏览器关闭时,是否可以从浏览器中删除PHPSESSID
?
Use 采用
session_set_cookie_params(0);
session_start();
With this your session will remain active until the browser is closed 这样,您的会话将保持活动状态,直到关闭浏览器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.