多长时间会话变量最后,如果你不取消它? [英] How long will a session variable last if you don't unset it?

查看:449
本文介绍了多长时间会话变量最后,如果你不取消它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我一个变量保存在session中(PHP),多长时间会在该文件变量流连忘返?它会在那里,直到有人不设置变量或删除该文件?

When I store a variable in a session (in php), how long will that variable linger in that file? Will it be there until someone unsets the variable or deletes the file?

更新:所以它的 session.gc-maxlifetime 设置在php.ini文件中设定。你可以通过调用的phpinfo检查您的设置()。矿为1440秒钟,这样24分钟。 可能发现重复这里,虽然在谷歌上搜索我没有发现它在第一,因为措辞。

update: so it is session.gc-maxlifetime setting that is set in php.ini file. You can check your setting by calling phpinfo(). Mine is set to 1440 seconds so 24 minutes. Might have found a duplicate here, although when googling I didn't find it at first because of the wording.

推荐答案

在默认情况下它会在那里24分钟。 (这是默认的php.ini文件设置)。

On default it will be there 24 minutes. (Which is the default php.ini file setting).

当你评论说,这是设置:<一href=\"http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime\">http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime

As you commented, this is the setting: http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime

这篇关于多长时间会话变量最后,如果你不取消它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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