![]() |
maybe need to modify session garbage collector section. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: maybe need to modify session garbage collector section. (/showthread.php?tid=72244) |
maybe need to modify session garbage collector section. - eterv - 11-26-2018 I think that maybe need to modify session garbage collector section. Session/Handlers/FileHandler.php public function gc(); original code is ... $pattern = sprintf( '/^%s[0-9a-f]{%d}$/', preg_quote($this->cookieName, '/'), ($this->matchIP === true ? 72 : 40) ); but, why 40? I can't understand this. for example, one of my session file name is a_sessionba2o0ekqqv8ogvqonrl2u0uqg86so8fm a_session is cookiename. so, session id is "ba2o0ekqqv8ogvqonrl2u0uqg86so8fm". the length of this string is 32. So, actually, in my case 32 is correct value. and I found this code part. in Session/Session.php protected function configureSidLength(); after be called this function, sidRegexp value is, "[0-9a-v]{32}" (in my case) So, I tried to modify gc part code. Here are some code. PHP Code: $sid_regexp = ''; After modify it, Finally My php Garbage Collector removed garbage session files. So, please modify this part properly. |