$_SESSION 数据存储在哪里以及何时被删除?
可能的重复:
$_SESSION 变量存储在哪里?
我使用它来跨页面存储一些数据请求(搜索表单中两个字段的状态):
session_start();
$_SESSION = $_POST;
我想知道会话存储在哪里?它们什么时候被删除?
Possible Duplicate:
Where are $_SESSION variables stored?
I'm using this to store some data across page requests (state of two fields from a search form):
session_start();
$_SESSION = $_POST;
I was wondering where are sessions stored? And when do they get deleted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们存储在
session_save_path
。当会话被删除时(在session_destroy
或session.gc_maxlifetime
),tmp文件被擦除,然后回收硬盘上的空间。They are stored in
session_save_path
. When the session is deleted (aftersession_destroy
orsession.gc_maxlifetime
), the tmp file is erased and then the space on the HD is reclaimed.它们存储在 php 服务器上,并在特定超时后当服务器没有收到来自关联客户端的请求时被删除。超时可在 php.ini 中配置或直接从脚本配置 。
They are stored on the php server, and get deleted after a certain timeout when the server hasn't had a request from the associated client. The timeout is configurable in php.ini or directly from your script.