{"id":22678283,"url":"https://github.com/hyperf-ext/cookie","last_synced_at":"2025-04-12T14:40:47.689Z","repository":{"id":56987678,"uuid":"292362594","full_name":"hyperf-ext/cookie","owner":"hyperf-ext","description":"The Hyperf Queued Cookie package.","archived":false,"fork":false,"pushed_at":"2023-02-15T16:19:38.000Z","size":21,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T09:11:49.411Z","etag":null,"topics":["cookie","hyperf","php"],"latest_commit_sha":null,"homepage":"","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/hyperf-ext.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-09-02T18:25:53.000Z","updated_at":"2024-12-16T06:01:27.000Z","dependencies_parsed_at":"2022-08-21T09:40:29.604Z","dependency_job_id":null,"html_url":"https://github.com/hyperf-ext/cookie","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf-ext%2Fcookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf-ext%2Fcookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf-ext%2Fcookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf-ext%2Fcookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperf-ext","download_url":"https://codeload.github.com/hyperf-ext/cookie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084883,"owners_count":21045135,"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","hyperf","php"],"created_at":"2024-12-09T18:14:40.289Z","updated_at":"2025-04-12T14:40:47.625Z","avatar_url":"https://github.com/hyperf-ext.png","language":"PHP","readme":"# Hyperf Cookie 组件\n\n该组件移植自 Laravel（[illuminate/cookie](https://github.com/illuminate/cookie )），功能与 Laravel 保持一致。\n\n\u003e 注意，该组件与 Hyperf 官方组件差异很大，使用时切勿混淆。\n\n## 安装\n\n```shell script\ncomposer require hyperf-ext/cookie\n```\n\n## 发布配置\n\n```shell script\nphp bin/hyperf.php vendor:publish hyperf-ext/cookie\n```\n\n\u003e 配置文件位于 `config/autoload/cookie.php`。\n\n## 设置\n\n在配置文件 `config/autoload/middlewares.php` 中添加全局中间件 `HyperfExt\\Cookie\\Middleware\\QueuedCookieMiddleware`。\n\n如需对 Cookie 加密，额外添加全局中间件 `HyperfExt\\Cookie\\Middleware\\EncryptCookieMiddleware`。\n\n\u003e 注意，使用 Cookie 加密中间件需要依赖 [`hyperf-ext/encryption`](https://github.com/hyperf-ext/encryption) 组件。\n\u003e 并且需求将该中间件放置在其他需要处理 Cookie 的中间件之前，以保证将请求中的加密 Cookie 解密。\n\n## 使用\n\n在任何需要设置 Cookie 的地方注入 `HyperfExt\\Cookie\\Contract\\CookieJarInterface`，该接口绑定的是 `HyperfExt\\Cookie\\CookieJar` 的代理类实例对象。\n\n该对象存储在当前请求的协程上下文中，在当前协程周期内访问到的都是同一个对象。\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf-ext%2Fcookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperf-ext%2Fcookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf-ext%2Fcookie/lists"}