更新时间:2023-12-04 21:02:28
随机到期是会话数据目录的经典症状,该会话数据目录由多个应用程序共享:session.gc_maxlifetime
时间最短的会话很可能会从其他应用程序中删除数据.原因:
Random expiration is a classical symptom of session data directory shared by several applications: the one with the shortest session.gc_maxlifetime
time is likely to remove data from other applications. The reason:
内置文件处理程序不跟踪谁拥有哪个会话文件(它仅将文件名与会话ID匹配):
The builtin file handler doesn't track who owns what session file (it just matches file name with session ID):
我的建议是,为应用程序配置私有自定义会话目录.可以使用 session_save_path()
函数或设置
My advice is that you configure a private custom session directory for your application. That can be done with the session_save_path()
function or setting the session.save_path
configuration directive. Please check your framework's documentation for the precise details on how to do it in your own codebase.