我有注销页面,当我单击注销或关闭选项卡时,会话将被销毁。我想如果用户忘记点击注销,如果用户访问该网站后4-5天仍然应该继续会话。
我有以下注销脚本:
<?php
session_start();
session_regenerate_id(true);
unset($_SESSION['uid']);
unset($_SESSION['uname']);
session_destroy();
header("location:http://shopeeon.com/");
?>发布于 2016-02-10 17:58:45
您需要在PHP配置文件中更改会话超时值。不要忘记重新启动Apache。See this answer。
发布于 2016-02-10 18:01:41
如果您希望用户在关闭浏览器后重新登录(并且会话终止),那么您需要使用cookie来安全地识别用户。
在这里搜索一些类似的问题;示例
发布于 2016-02-10 18:07:46
我在root中使用了这个htaccess:
<IfModule mod_php5.c>
#Session timeout
php_value session.cookie_lifetime 31536000
php_value session.gc_maxlifetime 31536000
</IfModule>https://stackoverflow.com/questions/35311754
复制相似问题