{"action":"created","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/942","repository_url":"https://api.github.com/repos/bcit-ci/CodeIgniter4","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/942/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/942/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/942/events","html_url":"https://github.com/bcit-ci/CodeIgniter4/issues/942","id":298178207,"number":942,"title":"FileHandler Garbage Collector fails to delete expired session files. ","user":{"login":"timothymarois","id":2489333,"avatar_url":"https://avatars0.githubusercontent.com/u/2489333?v=4","gravatar_id":"","url":"https://api.github.com/users/timothymarois","html_url":"https://github.com/timothymarois","followers_url":"https://api.github.com/users/timothymarois/followers","following_url":"https://api.github.com/users/timothymarois/following{/other_user}","gists_url":"https://api.github.com/users/timothymarois/gists{/gist_id}","starred_url":"https://api.github.com/users/timothymarois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothymarois/subscriptions","organizations_url":"https://api.github.com/users/timothymarois/orgs","repos_url":"https://api.github.com/users/timothymarois/repos","events_url":"https://api.github.com/users/timothymarois/events{/privacy}","received_events_url":"https://api.github.com/users/timothymarois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-19T07:04:13Z","updated_at":"2018-04-21T04:04:57Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"From testing on Amazon Linux EC2 with php 7.0 and php 7.1 the session files are not findable with the current file name detection. (using the default session save path)\r\n\r\nI would request this be looked more into, I modified the script to at least get it working on my setup for the time being (example below)\r\n\r\nOn a higher note, there is something going on with PHP 7+ session gc. From many tests, it is failing to actually clear out the expired session files, I am not entirely sure if this is strictly a CI issue. But it has affected most of my CI projects on different servers. \r\n\r\n\r\n**This did not work on the server:** \r\n```php\r\n\r\n$pattern = sprintf('/^%s[0-9a-f]{%d}$/', preg_quote($this->cookieName, '/'), ($this->matchIP === true ? 72 : 40));\r\n\r\nwhile (($file = readdir($directory)) !== false)\r\n{\r\n\t// If the filename doesn't match this pattern, it's either not a session file or is not ours\r\n\tif ( ! preg_match($pattern, $file) || ! is_file($this->savePath . '/' . $file) || ($mtime = filemtime($this->savePath . '/' . $file)) === false || $mtime > $ts)\r\n\t{\r\n\t\tcontinue;\r\n\t}\r\n\r\n\tunlink($this->savePath . '/' . $file);\r\n}\r\n\r\n```\r\n\r\n\r\n**I ran this instead:** \r\n\r\n```php\r\n\r\nwhile (($file = readdir($directory)) !== false)\r\n{\r\n            $mtime = filemtime($savePath . '/' . $file);\r\n\r\n            if (preg_match('|^ci_session|', $file) && $mtime < $ts)\r\n            {\r\n                unlink($savePath . '/' . $file);\r\n            }\r\n\r\n}\r\n\r\n```\r\n\r\nI did not look into which part of the if statement was causing this issue, but I am adding this here as it needs to be investigated further. "},"comment":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/comments/383265948","html_url":"https://github.com/bcit-ci/CodeIgniter4/issues/942#issuecomment-383265948","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter4/issues/942","id":383265948,"user":{"login":"lonnieezell","id":51931,"avatar_url":"https://avatars2.githubusercontent.com/u/51931?v=4","gravatar_id":"","url":"https://api.github.com/users/lonnieezell","html_url":"https://github.com/lonnieezell","followers_url":"https://api.github.com/users/lonnieezell/followers","following_url":"https://api.github.com/users/lonnieezell/following{/other_user}","gists_url":"https://api.github.com/users/lonnieezell/gists{/gist_id}","starred_url":"https://api.github.com/users/lonnieezell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonnieezell/subscriptions","organizations_url":"https://api.github.com/users/lonnieezell/orgs","repos_url":"https://api.github.com/users/lonnieezell/repos","events_url":"https://api.github.com/users/lonnieezell/events{/privacy}","received_events_url":"https://api.github.com/users/lonnieezell/received_events","type":"User","site_admin":false},"created_at":"2018-04-21T04:04:57Z","updated_at":"2018-04-21T04:04:57Z","author_association":"COLLABORATOR","body":"@timothymarois Can you check your php.ini file on your Amazon server and tell me what the values are for: \r\n\r\n```\r\nsession.gc_maxlifetime = 3600\r\nsession.gc_probability = 1\r\nsession.gc_divisor = 1000\r\n```"}}
{"actor":{"display_login":"lonnieezell"}}