{"id":15789816,"url":"https://github.com/ytake/hack-cookie","last_synced_at":"2026-02-25T17:41:31.858Z","repository":{"id":57088270,"uuid":"254355381","full_name":"ytake/hack-cookie","owner":"ytake","description":"HHVM and Hack Cookies for facebook/hack-http-request-response-interfaces","archived":false,"fork":false,"pushed_at":"2020-07-14T04:42:28.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T19:45:39.794Z","etag":null,"topics":["cookie","hack","hacklang","hhvm","http"],"latest_commit_sha":null,"homepage":"","language":"Hack","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/ytake.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":"2020-04-09T11:41:57.000Z","updated_at":"2020-10-25T09:27:44.000Z","dependencies_parsed_at":"2022-08-20T16:00:28.768Z","dependency_job_id":null,"html_url":"https://github.com/ytake/hack-cookie","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ytake/hack-cookie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhack-cookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhack-cookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhack-cookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhack-cookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytake","download_url":"https://codeload.github.com/ytake/hack-cookie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhack-cookie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29832974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T17:17:09.781Z","status":"ssl_error","status_checked_at":"2026-02-25T17:16:50.421Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","hack","hacklang","hhvm","http"],"created_at":"2024-10-04T22:03:43.198Z","updated_at":"2026-02-25T17:41:31.840Z","avatar_url":"https://github.com/ytake.png","language":"Hack","readme":"# Hack Cookie\n\n[![Build Status](https://travis-ci.org/ytake/hack-cookie.svg?branch=master)](https://travis-ci.org/ytake/hack-cookie)\n\nManaging Cookies for [facebook/hack-http-request-response-interfaces](https://github.com/hhvm/hack-http-request-response-interfaces).\n\nSupported Only Hack library.\nRequired HHVM \u003e= 4.41.0\n\n - [ytake/hungrr](https://github.com/ytake/hungrr)\n - [usox/hackttp](https://github.com/usox/hackttp)\n\n## Installation\n\n```bash\n$\u003e composer require ytake/hack-cookie\n```\n\n## Basic Usage\n\n### Request Cookies\n\n```hack\nuse type Ytake\\HackCookie\\Cookie;\n\n$cookie = Cookie::create('theme', 'blue');\n```\n\n#### Get a Request Cookie\n\n```hack\nuse type Ytake\\HackCookie\\RequestCookies;\nuse type Ytake\\Hungrr\\{Request, Uri};\nuse namespace HH\\Lib\\IO;\n\n$request = new Request(Message\\HTTPMethod::GET, new Uri('/'), IO\\request_input);\n\n$cookie = RequestCookies::get($request, 'theme');\n$cookie = RequestCookies::get($request, 'theme', 'default-theme');\n```\n\n#### Set a Request Cookie\n\n```hack\nuse type Ytake\\HackCookie\\RequestCookies;\nuse type Ytake\\Hungrr\\{Request, Uri};\nuse namespace HH\\Lib\\IO;\n\n$request = new Request(Message\\HTTPMethod::GET, new Uri('/'), IO\\request_input);\n\n$request = RequestCookies::set($request, Cookie::create('theme', 'blue'));\n```\n\n#### Modify a Request Cookie\n\n```hack\nuse type Ytake\\HackCookie\\{Cookie, Cookies, RequestCookies};\nuse type Ytake\\Hungrr\\{Request, Uri};\nuse namespace HH\\Lib\\IO;\n\n$modify = (Cookie $cookie) ==\u003e { \n  return $cookie-\u003egetValue()\n    |\u003e $cookie-\u003ewithValue($$);\n}\n$request = new Request(Message\\HTTPMethod::GET, new Uri('/'), IO\\request_input);\n$request = RequestCookies::modify($request, 'theme', $modify);\n```\n\n### Response Cookies\n\n```hack\nuse type Ytake\\HackCookie\\{SameSite, SetCookie};\n\nSetCookie::create('lu')\n  -\u003ewithValue('Rg3vHJZnehYLjVg7qi3bZjzg')\n  -\u003ewithExpires(new \\DateTime('Tue, 15-Jan-2020 21:47:38 GMT'))\n  -\u003ewithMaxAge(500)\n  -\u003ewithPath('/')\n  -\u003ewithDomain('.example.com')\n  -\u003ewithSecure(true)\n  -\u003ewithHttpOnly(true)\n  -\u003ewithSameSite(SameSite::LAX);\n```\n\nand more.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytake%2Fhack-cookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytake%2Fhack-cookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytake%2Fhack-cookie/lists"}