{"id":20678883,"url":"https://github.com/phpgt/session","last_synced_at":"2025-04-19T23:45:15.389Z","repository":{"id":26831823,"uuid":"109600235","full_name":"phpgt/Session","owner":"phpgt","description":"Encapsulated user sessions.","archived":false,"fork":false,"pushed_at":"2023-10-19T11:08:00.000Z","size":253,"stargazers_count":1,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T23:45:09.593Z","etag":null,"topics":["cookie","phpgt","session-cookie","session-handler","session-management","sessionstorage"],"latest_commit_sha":null,"homepage":"https://www.php.gt/session","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/phpgt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["phpgt"]}},"created_at":"2017-11-05T17:24:57.000Z","updated_at":"2021-11-04T14:38:32.000Z","dependencies_parsed_at":"2024-06-09T18:05:23.115Z","dependency_job_id":null,"html_url":"https://github.com/phpgt/Session","commit_stats":{"total_commits":139,"total_committers":6,"mean_commits":"23.166666666666668","dds":"0.40287769784172667","last_synced_commit":"954cc13e0973089ab73d7739f43e3128c2be01b3"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSession","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSession/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSession/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSession/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpgt","download_url":"https://codeload.github.com/phpgt/Session/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249830845,"owners_count":21331357,"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":["cookie","phpgt","session-cookie","session-handler","session-management","sessionstorage"],"created_at":"2024-11-16T21:22:55.186Z","updated_at":"2025-04-19T23:45:15.303Z","avatar_url":"https://github.com/phpgt.png","language":"PHP","readme":"# Encapsulated user sessions.\n\nThis library is a simple object oriented alternative to the $_SESSION superglobal allowing application code to be passed encapsulated `SessionStore` objects, so areas of code can have access to their own Session area without having full read-write access to all session variables.\n\nSessions are addressed using dot notation, allowing for handling categories of session data. This is particularly useful when dealing with user authentication, for example.\n\n***\n\n\u003ca href=\"https://github.com/PhpGt/Session/actions\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/session-build.svg\" alt=\"Build status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/Session\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/session-quality.svg\" alt=\"Code quality\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/PhpGt/Session\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/session-coverage.svg\" alt=\"Code coverage\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/PhpGt/Session\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/session-version.svg\" alt=\"Current version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.php.gt/session\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/session-docs.svg\" alt=\"PHP.Gt/Session documentation\" /\u003e\n\u003c/a\u003e\n\n## Example usage: Welcome a user by their first name or log out the user\n\n```php\nif($session-\u003econtains(\"auth\")) {\n// Remove the *whole* auth section of the session on logout.\n\tif($action === \"logout\") {\n\t\t$session-\u003edelete(\"auth\");\n\t}\n\telse {\n// Output a variable within the auth namespace:\n\t\t$message = \"Welcome back, \" . $session-\u003egetString(\"auth.user.name\");\n\t}\n}\nelse {\n// Pass the \"auth\" store to a class, so it \n// can't read/write to other session variables:\n\tAuthenticationSystem::beginLogin($session-\u003egetStore(\"auth\"));\n}\n```\n","funding_links":["https://github.com/sponsors/phpgt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fsession","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpgt%2Fsession","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fsession/lists"}