{"id":18783664,"url":"https://github.com/tomkyle/cookies","last_synced_at":"2025-12-20T18:30:16.861Z","repository":{"id":15772460,"uuid":"18511459","full_name":"tomkyle/Cookies","owner":"tomkyle","description":"A small PHP library for dealing with cookies","archived":false,"fork":false,"pushed_at":"2014-04-18T13:03:19.000Z","size":272,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:17:14.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tomkyle.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":"2014-04-07T09:02:56.000Z","updated_at":"2014-04-18T13:03:19.000Z","dependencies_parsed_at":"2022-09-25T08:23:15.846Z","dependency_job_id":null,"html_url":"https://github.com/tomkyle/Cookies","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FCookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FCookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FCookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FCookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomkyle","download_url":"https://codeload.github.com/tomkyle/Cookies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699579,"owners_count":19682574,"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":[],"created_at":"2024-11-07T20:40:03.754Z","updated_at":"2025-12-20T18:30:16.784Z","avatar_url":"https://github.com/tomkyle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Cookies\n\nSmall and simple PHP library for dealing with cookies.\n\n[![Build Status](https://travis-ci.org/tomkyle/Cookies.svg?branch=master)](https://travis-ci.org/tomkyle/Cookies)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/tomkyle/Cookies/badges/quality-score.png?s=e1e8eaac2d69db9564c723d289bea895e1976bb9)](https://scrutinizer-ci.com/g/tomkyle/Cookies/)\n[![Coverage Status](https://coveralls.io/repos/tomkyle/Cookies/badge.png?branch=master)](https://coveralls.io/r/tomkyle/Cookies?branch=master)\n\n##Set  cookie\n```php\n\u003c?php\nuse \\tomkyle\\Cookies\\Cookie;\nuse \\tomkyle\\Cookies\\SendCookie;\nuse \\tomkyle\\Cookies\\UnsetCookie;\n\n// Most simple\n$c1 = new Cookie( \"foo\", \"bar\" );\n\n// Optionally set expiration:\n$c1-\u003esetExpiration( new \\DateTime( \"14day\" ));\n\n// Fire cookie:\nnew SendCookie( $c1 );\n\n// Another example\n$c2 = new Cookie( \"any\", \"val\", new \\DateTime( \"tomorrow\" ) );\nnew SendCookie( $c2 );\n\n// Delete from HTTP and $_COOKIE:\nnew UnsetCookie( $c2 );\n```\n\n\n##Retrieve cookie\n```php\n\u003c?php\nuse \\tomkyle\\Cookies\\Cookie;\nuse \\tomkyle\\Cookies\\RequestCookie;\nuse \\tomkyle\\Cookies\\SendCookie;\n\n// Fire cookie:\nnew SendCookie( new Cookie( \"foo\", \"bar\" ) );\n\n// Retrieve cookie from next request:\n$rc = new RequestCookie(\"foo\");\necho $rc; // outputs \"bar\"\necho $rc-\u003egetValue(); // outputs \"bar\"\n```\n\n\n##Installation via Composer\n\nThis library has no dependencies. Install from command line or `composer.json` file:\n\n#####Command line\n    \n    composer require tomkyle/cookies\n\n#####composer.json\n    \"require\": {\n        \"tomkyle/cookies\": \"dev-master\"\n    }\n\n##Classes Overview\n\n- *interface* CookieInterface\r- *abstract* CookieAbstract\r- Cookie *extends* CookieAbstract\r- RequestCookie *extends* CookieAbstract\r- SendCookie\r- UnsetCookie\n\n\n##Supported Attributes\n\n- Cookie name\n- Cookie value\n- Expiration/Life time\n- **Not supported:** Path\n- **Not supported:** Domain\n- **Not supported:** Secure (HTTPS only)\n- **Not supported:** http-only protection\n\n[PHP documentation on setcookie](http://www.php.net/manual/en/function.setcookie.php)\n\n\n##Testing\n\nSimply issue `phpunit` to run the test suites; you may have to `composer update`first.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fcookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomkyle%2Fcookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fcookies/lists"}