{"id":18463727,"url":"https://github.com/commandstring/cookies","last_synced_at":"2025-03-11T09:47:38.600Z","repository":{"id":57431019,"uuid":"527104516","full_name":"CommandString/Cookies","owner":"CommandString","description":"A simpler way to manipulate cookies in PHP","archived":false,"fork":false,"pushed_at":"2023-12-02T21:03:10.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T00:12:10.369Z","etag":null,"topics":[],"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/CommandString.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":"2022-08-21T04:26:23.000Z","updated_at":"2023-01-20T06:41:28.000Z","dependencies_parsed_at":"2023-02-12T00:10:13.045Z","dependency_job_id":null,"html_url":"https://github.com/CommandString/Cookies","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FCookies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FCookies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FCookies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FCookies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CommandString","download_url":"https://codeload.github.com/CommandString/Cookies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243012658,"owners_count":20221606,"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":[],"created_at":"2024-11-06T09:07:48.122Z","updated_at":"2025-03-11T09:47:38.568Z","avatar_url":"https://github.com/CommandString.png","language":"PHP","readme":"\n# [CommandString/Cookies](https://packagist.org/packages/commandstring/cookies) - A simpler way to manipulate cookies in PHP #\n\n### Install with Composer using `composer require commandstring/cookies` ###\n\n## Requirements ##\n- PHP \u003e=8.0\n- Basic understanding of PHP OOP\n- Composer 2\n\n## Basic Usage ##\n```php\nrequire  __DIR__.\"/vendor/autoload.php\";\nuse CommandString\\Cookies\\Cookie;\n\n$cookies = new Cookie();\n\n#                              v hours \n#                              v valid   v seconds valid\n$cookies-\u003eset(\"name\", \"value\", 168, 10, 30); // by default cookies expire in a week\n#                                   ^ minutes valid\n\n// After page refresh //\necho $cookies-\u003eget(\"name\"); // output: value\n\n// Delete cookie //\n$cookie-\u003edelete(\"name\"); // remove the cookie\n\n// Delete all cookies\n$cookie-\u003edeleteAll();\n\n// Check if a cookie exists\n$cookie-\u003eexists(\"name\"); // returns bool\n```\n\n## Using CommandString/Encrypt with CommandString/Cookies ##\n### *[I recommend checking out the README for CommandString/Encrypt](https://github.com/CommandString/encrypt#basic-usage)* ###\n```php\nuse CommandString\\CookieEncryption\\CookieEncryption;\nuse CommandString\\Cookies\\Cookie;\n\n// use the cookieEncryption class that wraps around cmdstr/encrypt/encryption class\n$cookies = new Cookie(new CookieEncryption(\"MZCdg02STLzrsj05KE3SIL62SSlh2Ij\", \"AES-256-CTR\"));\n// ... now cmdstr/encrypt will handle encrypting cookies\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommandstring%2Fcookies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommandstring%2Fcookies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommandstring%2Fcookies/lists"}