{"id":16761767,"url":"https://github.com/hansott/psr7-cookies","last_synced_at":"2025-08-22T11:11:17.861Z","repository":{"id":9534011,"uuid":"61661349","full_name":"hansott/psr7-cookies","owner":"hansott","description":"🍪  bakes cookies for PSR-7 messages","archived":false,"fork":false,"pushed_at":"2024-02-26T17:33:37.000Z","size":504,"stargazers_count":40,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-29T02:18:41.250Z","etag":null,"topics":["cookies","http","php","psr-7"],"latest_commit_sha":null,"homepage":"https://hansott.github.io","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/hansott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["hansott"]}},"created_at":"2016-06-21T19:30:58.000Z","updated_at":"2024-07-16T01:45:46.000Z","dependencies_parsed_at":"2024-06-18T16:55:28.317Z","dependency_job_id":"c4a2266d-7264-4485-9bda-f87aa086aaee","html_url":"https://github.com/hansott/psr7-cookies","commit_stats":{"total_commits":76,"total_committers":5,"mean_commits":15.2,"dds":"0.10526315789473684","last_synced_commit":"fdd4790274996a3d5a723fa32d1c82e2b319e8fc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/hansott/psr7-cookies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansott%2Fpsr7-cookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansott%2Fpsr7-cookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansott%2Fpsr7-cookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansott%2Fpsr7-cookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansott","download_url":"https://codeload.github.com/hansott/psr7-cookies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansott%2Fpsr7-cookies/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271628166,"owners_count":24792821,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cookies","http","php","psr-7"],"created_at":"2024-10-13T04:43:26.237Z","updated_at":"2025-08-22T11:11:17.832Z","avatar_url":"https://github.com/hansott.png","language":"PHP","funding_links":["https://github.com/sponsors/hansott"],"categories":[],"sub_categories":[],"readme":"# ![PSR-7 Cookies](art/psr7-cookies.jpg)\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Supported PHP versions][ico-php-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Software License][ico-license]](LICENSE.md)\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require hansott/psr7-cookies\n```\n\n## Usage\n\n### Add cookie to Psr\\Http\\Message\\ResponseInterface\n\n```php\n\u003c?php\n\nuse HansOtt\\PSR7Cookies\\SetCookie;\n\n// Set a cookie with custom values.\n$cookie = new SetCookie('name', 'value', time() + 3600, '/path', 'domain.tld', $secure, $httpOnly, $sameSite);\n\n// Set a cookie to delete a cookie.\n$cookie = SetCookie::thatDeletesCookie('name');\n\n// Set a cookie that stays forever (5 years)\n$cookie = SetCookie::thatStaysForever('name', 'value');\n\n// Set a cookie that expires at a given time.\n$now = new DateTimeImmutable();\n$tomorrow = $now-\u003emodify('tomorrow');\n$cookie = SetCookie::thatExpires('name', 'value', $tomorrow);\n\n// Add the cookie to a response\n$responseWithCookie = $cookie-\u003eaddToResponse($response);\n```\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email **hans at iott consulting** instead of using the issue tracker.\n\n## Credits\n\n- [Hans Ott][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/hansott/psr7-cookies.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/hansott/psr7-cookies.svg?style=flat-square\n[ico-php-version]: https://img.shields.io/packagist/php-v/hansott/psr7-cookies.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/hansott/psr7-cookies\n[link-downloads]: https://packagist.org/packages/hansott/psr7-cookies\n[link-author]: https://github.com/hansott\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansott%2Fpsr7-cookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansott%2Fpsr7-cookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansott%2Fpsr7-cookies/lists"}