{"id":13711984,"url":"https://github.com/ellipsephp/cookie-encryption","last_synced_at":"2025-12-30T18:39:21.448Z","repository":{"id":56976834,"uuid":"111228631","full_name":"ellipsephp/cookie-encryption","owner":"ellipsephp","description":"Psr-15 middleware allowing to encrypt cookies using defuse/php-encryption","archived":false,"fork":false,"pushed_at":"2023-05-01T12:58:16.000Z","size":12,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-03T16:03:01.471Z","etag":null,"topics":["cookie","encryption","middleware","psr-15","psr-7"],"latest_commit_sha":null,"homepage":"https://github.com/ellipsephp/cookie-encryption","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/ellipsephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-11-18T18:22:43.000Z","updated_at":"2024-04-18T00:43:52.000Z","dependencies_parsed_at":"2024-05-13T00:40:34.039Z","dependency_job_id":"36748230-b533-4d45-9cf1-7b0332ce94af","html_url":"https://github.com/ellipsephp/cookie-encryption","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.4545454545454546,"last_synced_commit":"4dba3593f80bd199ea96e2b514d93c908f7e6288"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellipsephp%2Fcookie-encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellipsephp%2Fcookie-encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellipsephp%2Fcookie-encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellipsephp%2Fcookie-encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ellipsephp","download_url":"https://codeload.github.com/ellipsephp/cookie-encryption/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772239,"owners_count":21801885,"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","encryption","middleware","psr-15","psr-7"],"created_at":"2024-08-02T23:01:13.675Z","updated_at":"2025-12-30T18:39:21.421Z","avatar_url":"https://github.com/ellipsephp.png","language":"PHP","readme":"# Cookie encryption\n\nThis package provides a [Psr-15 middleware](https://www.php-fig.org/psr/psr-15/) allowing to encrypt cookies using [defuse/php-encryption](https://github.com/defuse/php-encryption).\n\n**Require** php \u003e= 7.3\n\n**Installation** `composer require ellipse/cookie-encryption`\n\n**Run tests** `./vendor/bin/kahlan`\n\n- [Getting started](#getting-started)\n\n# Getting started\n\nThis middleware takes an instance of `Defuse\\Crypto\\Key` from the [defuse/php-encryption](https://github.com/defuse/php-encryption) package and an array of bypassed cookie names as parameters. It will use defuse encryption mechanism to decrypt the cookies attached to the Psr-7 request and encrypt the cookies attached to the Psr-7 response. The cookies with a name in the bypassed array will stay untouched. When the decryption fails for one cookie, its value is set as an empty string.\n\n```php\n\u003c?php\n\nnamespace App;\n\nuse Defuse\\Crypto\\Key;\nuse Ellipse\\Cookies\\EncryptCookiesMiddleware;\n\n// Load an encryption key from your config.\n$key = Key::loadFromAsciiSafeString(getenv('APP_KEY'));\n\n// By using this middleware all cookies will be decrypted/encrypted, except the one named 'bypassed'.\n$middleware = new EncryptCookiesMiddleware($key, ['bypassed']);\n```\n","funding_links":[],"categories":["Packages"],"sub_categories":["Security"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellipsephp%2Fcookie-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fellipsephp%2Fcookie-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellipsephp%2Fcookie-encryption/lists"}