{"id":37235555,"url":"https://github.com/constanze-standard/cookies","last_synced_at":"2026-01-16T04:51:23.141Z","repository":{"id":56957482,"uuid":"211256733","full_name":"constanze-standard/cookies","owner":"constanze-standard","description":"The Cookies respond middleware","archived":false,"fork":false,"pushed_at":"2019-11-17T06:08:55.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T09:16:34.016Z","etag":null,"topics":["cookie","php","psr","psr-7","response"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/constanze-standard.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-09-27T07:02:26.000Z","updated_at":"2019-11-17T06:06:59.000Z","dependencies_parsed_at":"2022-08-21T08:50:55.432Z","dependency_job_id":null,"html_url":"https://github.com/constanze-standard/cookies","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/constanze-standard/cookies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constanze-standard%2Fcookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constanze-standard%2Fcookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constanze-standard%2Fcookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constanze-standard%2Fcookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/constanze-standard","download_url":"https://codeload.github.com/constanze-standard/cookies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constanze-standard%2Fcookies/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cookie","php","psr","psr-7","response"],"created_at":"2026-01-15T04:03:12.460Z","updated_at":"2026-01-15T04:03:13.173Z","avatar_url":"https://github.com/constanze-standard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Constanze Standard: Cookies\nCookie support for PSR-7 response.\n\n## Installation\n```sh\ncomposer require constanze-standard/cookies\n```\n\n## Usage\nAdd a Cookie to collection with `addCookie`.\n```php\nuse ConstanzeStandard\\Cookies\\Cookie;\nuse ConstanzeStandard\\Cookies\\CookieCollection;\n\n$cookie = new Cookie('name', 'value', 60);\n\n$cookieCollection = new CookieCollection();\n$cookieCollection-\u003eaddCookie($cookie);\n```\n\nOr you can add cookie with method `add`, it will return the new created `Cookie` instance:\n```php\nuse ConstanzeStandard\\Cookies\\CookieCollection;\n\n$cookieCollection = new CookieCollection();\n/** @var \\ConstanzeStandard\\Cookies\\Cookie $cookie */\n$cookie = $cookieCollection-\u003eadd('name', 'value', 60);\n```\n\nThe cookie's arguments:\n- `string $name` The name of the cookie.\n- `string $value` The value of the cookie.\n- `int $expireTime` The time of cookie expires relatively to current timestamp.\n- `string $path` The path on the server in which the cookie will be available on.\n- `string $domain` The (sub)domain that the cookie is available to.\n- `bool $secure` Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.\n- `bool $httponly` When TRUE the cookie will be made accessible only through the HTTP protocol.\n\nYou can set default value for `domain` and `secure` with construct of `CookieCollection`.\n```php\n$cookieCollection = new CookieCollection('localhost', true);\n```\nIf you add a cookie with empty `domain` or `secure`, the collection will use the default value.\n\nSet cookies for PSR-7 response:\n```php\n/**\n * @var \\Psr\\Http\\Message\\ResponseInterface $response\n * @var \\Psr\\Http\\Message\\ResponseInterface $newResponse\n */\n$newResponse = $cookieCollection-\u003emakeResponse($response);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstanze-standard%2Fcookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstanze-standard%2Fcookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstanze-standard%2Fcookies/lists"}