{"id":20678894,"url":"https://github.com/phpgt/cookie","last_synced_at":"2025-07-05T02:35:25.911Z","repository":{"id":26831830,"uuid":"109600220","full_name":"phpgt/Cookie","owner":"phpgt","description":"Object oriented cookie handler.","archived":false,"fork":false,"pushed_at":"2025-04-22T13:53:54.000Z","size":206,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T16:55:42.744Z","etag":null,"topics":["cookie","cookiejar","cookies","http","object-oriented","php-cookie","phpgt"],"latest_commit_sha":null,"homepage":"https://www.php.gt/cookie","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["phpgt"]}},"created_at":"2017-11-05T17:24:41.000Z","updated_at":"2025-04-21T14:01:49.000Z","dependencies_parsed_at":"2024-11-16T21:25:35.637Z","dependency_job_id":"e46d49b5-ef44-4d7a-b33c-58d9f82da991","html_url":"https://github.com/phpgt/Cookie","commit_stats":{"total_commits":110,"total_committers":5,"mean_commits":22.0,"dds":0.4545454545454546,"last_synced_commit":"4500237be90e026354b9eab3ebf7a96103ee5cca"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/phpgt/Cookie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpgt","download_url":"https://codeload.github.com/phpgt/Cookie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCookie/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261759189,"owners_count":23205511,"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","cookiejar","cookies","http","object-oriented","php-cookie","phpgt"],"created_at":"2024-11-16T21:22:58.703Z","updated_at":"2025-06-24T21:31:50.537Z","avatar_url":"https://github.com/phpgt.png","language":"PHP","readme":"Object oriented cookie handler.\n-------------------------------\n\nThis library is an object oriented alternative to the `$_COOKIE` superglobal that can be read using the same associative array style code. The `Cookie` class represents cookie data in immutable objects, meaning that the state of the request/response cookies cannot be accidentally changed by undisclosed areas of code.\n\n***\n\n\u003ca href=\"https://github.com/PhpGt/Cookie/actions\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cookie-build.svg\" alt=\"Build status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/Cookie\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cookie-quality.svg\" alt=\"Code quality\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/Cookie\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cookie-coverage.svg\" alt=\"Code coverage\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/PhpGt/Cookie\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cookie-version.svg\" alt=\"Current version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.php.gt/cookie\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cookie-docs.svg\" alt=\"PHP.Gt/Cookie documentation\" /\u003e\n\u003c/a\u003e\n\n## Example usage\n\n```php\n// Create a replacement for $_COOKIE.\n$cookie = new Gt\\Cookie\\CookieHandler($_COOKIE);\n\n// Access values as normal.\n$value = $cookie[\"firstVisit\"];\n\nif(isset($cookie[\"firstVisit\"])) {\n// Cookie \"firstVisit\" exists.\n}\n\nif($cookie-\u003ehas(\"firstVisit\")) {\n// Cookie \"firstVisit\" exists.\n}\nelse {\n// Create a new cookie that expires in ten days.\n\t$now = new DateTime();\n\t$expire = new DateTime(\"+10 days\");\n\t$cookie-\u003eset(\"firstVisit\", $now, $expire);\n}\n\n// Now you can unset the superglobal!\n```\n\n## What's not covered?\n\nThis library does not touch on encrypting cookies. To store sensitive information across HTTP requests, use a session variable. To ensure cookies can't be read by JavaScript, use a secure HTTP-only cookie.\n","funding_links":["https://github.com/sponsors/phpgt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fcookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpgt%2Fcookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fcookie/lists"}