php如何设置session过期
2022-12-02 09:01:16
216
{{single.collect_count}}

php设置session过期的方法:首先打开PHP配置文件所在目录,找到配置文件;然后搜索“maxlifetime”;最后修改“session.gc_maxlifetime”的时间数值即可。

php入门到就业线上直播课:进入学习
Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用

本教程操作环境:Windows7系统、PHP7.1版,Dell G3电脑。

php设置session过期时间

关于PHP中session过期时间的认识:

6aeb20ddd827c6d8f835ffc0eb92ed7.png

打开PHP配置文件所在目录,找到配置文件

12631d9a0f600476d9519b68ee89c81.png

打开PHP配置文件,并搜索:maxlifetime

9a86f87318b48e1bcedf9673ff909fc.png

看到:session.gc_maxlifetime=1440,即为session的默认有效时间

f897a404531c3eba85a5e2c4878afde.png

修改session.gc_maxlifetime

22d9cd100bd923c42f22b9999cc459d.png

修改PHP配置文件后需要重启服务。

推荐:《PHP视频教程

以上就是php如何设置session过期的详细内容,更多请关注php中文网其它相关文章!

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}