codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.35k stars 1.9k forks source link

CI_VERSION = '4.0.0-beta.4'; session 文件file缓存问题失效问题;session_start(): Failed to decode session object. Session has been destroyed #3485

Closed xayts closed 4 years ago

xayts commented 4 years ago

error: file=/var/www/nvwa/vendor/codeigniter4/framework/system/Session/Session.php0 #984|err_msg=ErrorException:session_start(): Failed to decode session object. Session has been destroyed|

version: CI_VERSION = '4.0.0-beta.4'; php version = 7.2.2 nginx = 1.18 windows for docker

Describe the bug: 当一个页面有很多次接口调用时,file 存储的session 就会失效(被删除掉); When a page has many interface calls, the session stored in the file will be invalid (deleted)

InsiteFX commented 4 years ago

You need to upgrade CodeIgniter the new version is 4.0.4 It is no longer in beta.

xayts commented 4 years ago

我和我的同事们对了一下,他的本地的开发环境和我不同,他们没有出现这样的问题,我猜想可能是我本地环境(docker)的问题。 我们已经在生产环境使用,过段时间工作不忙的时候,会升级下看看的,谢谢

My colleagues and I have a look. His local development environment is different from mine. They don't have such problems. I guess it may be my local environment (docker).

We have used it in the production environment. When we are not busy, we will upgrade it,thank

xayts commented 3 years ago

file:vendor\codeigniter4\framework\system\Session\Handlers\FileHandler.php line:205 clearstatcache(true,$this->filePath . $sessionID); 问题:filesize() 函数缓存导致,当页面多个ajax 请求时,且存在请求对于 session 进行修改 清除session文件,php缓存

Problem: the file size() function cache causes that when the page has multiple Ajax requests, and there are requests to modify the session

Clear session file, PHP cache

image