{"id":15026334,"url":"https://github.com/mferly/session-parser","last_synced_at":"2026-02-11T02:42:10.002Z","repository":{"id":62527706,"uuid":"223506174","full_name":"mferly/session-parser","owner":"mferly","description":"Use this to iterate through active session files within the defined PHP sessions folder found in php.ini to look for authenticated sessions.","archived":false,"fork":false,"pushed_at":"2020-08-01T02:48:27.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T20:23:49.709Z","etag":null,"topics":["namespaces-php","oop","php","php7","php73"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mferly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-23T00:04:12.000Z","updated_at":"2019-12-14T16:39:26.000Z","dependencies_parsed_at":"2022-11-02T15:31:14.728Z","dependency_job_id":null,"html_url":"https://github.com/mferly/session-parser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mferly%2Fsession-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mferly%2Fsession-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mferly%2Fsession-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mferly%2Fsession-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mferly","download_url":"https://codeload.github.com/mferly/session-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330323,"owners_count":20274039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["namespaces-php","oop","php","php7","php73"],"created_at":"2024-09-24T20:04:17.938Z","updated_at":"2026-02-11T02:42:04.979Z","avatar_url":"https://github.com/mferly.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SessionParser\nUse this to iterate through active session files within the defined PHP sessions folder found in `php.ini`\n\n**Hint**: your sessions directory is probably located at `/var/lib/php/sessions/`\n\n* [Getting Started](#getting-started)\n* [Basic Usage](#basic-usage)\n* [Prerequisites](#prerequisites)\n* [After Thoughts](#after-thoughts)\n* [Contributing](#contributing)\n* [Licence](#licence)\n* [Creator](#creator)\n\n## Getting Started\n\n**WARNING**: Don't keep these files in a `public` folder of any kind.\n\nDue to permission issues you'll likely run into if you attempt to execute this from the browser, use CLI only.\n\nYou'll want to have a look at `private static $needle = 'auth|b:1';` in `SessionParser.php` and make the necessary change to reflect your `$_SESSION` key. The Docblock has more info.\n\n## Basic Usage\n\nYou can pass your session directory to `(new \\SessionParser\\SessionParser)::init()` as an argument or just use the default as stated in `private static $sessionFolderPath = '/var/lib/php/sessions/';`\n\nYou'll likely have to `sudo` the following command for it to work. Or just run as `root`. Whatever works for your ENV.\n\n`$ sudo php -f index.php`\n\nShould return number of active sessions `¯\\_(ツ)_/¯`\n\nThis is where a check is being made to determine length of time between current time - session file modified time, and if it's within bounds set by `static::$sessionGcMaxlifetime` then `static::$counter` is iterated.\n```php\nif (time() - $file-\u003egetCTime() \u003c= static::$sessionGcMaxlifetime) {\n    static::$counter++;\n}\n```\n\n## Prerequisites\n* PHP v7.x (tested on v7.3.11)\n\n## After Thoughts\nWhile this program will simply `echo` the result, there is no reason this cannot be modified to write the result to a file, database, emailed to a recipient, etc.\n\n## Contributing\n* [PSR](https://www.php-fig.org/) must be followed.\n* All classes **MUST** implement an interface. Pull requests with classes that do not implement an interface will be rejected.\n\n## Licence\n[MIT](https://opensource.org/licenses/MIT)\n\n## Creator\n[mferly](https://www.reddit.com/user/mferly)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmferly%2Fsession-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmferly%2Fsession-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmferly%2Fsession-parser/lists"}