{"id":23670751,"url":"https://github.com/odroe/ocookie","last_synced_at":"2026-03-13T09:02:06.451Z","repository":{"id":40612631,"uuid":"258554604","full_name":"odroe/ocookie","owner":"odroe","description":"🍪 Cookie and Set-Cookie parser and serializer","archived":false,"fork":false,"pushed_at":"2026-02-13T15:58:17.000Z","size":38,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-14T00:25:40.983Z","etag":null,"topics":["cookie","dart","parser","serializer","set-cookie"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/ocookie","language":"Dart","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/odroe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"medz"}},"created_at":"2020-04-24T15:43:06.000Z","updated_at":"2026-02-06T08:20:07.000Z","dependencies_parsed_at":"2024-11-05T15:36:21.916Z","dependency_job_id":"d80b8213-4f11-4cb1-b6b5-c28293021102","html_url":"https://github.com/odroe/ocookie","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"5f4fc335ceae49aeb5d33a36e4161b805a13dd86"},"previous_names":["odroe/ocookie"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/odroe/ocookie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Focookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Focookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Focookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Focookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odroe","download_url":"https://codeload.github.com/odroe/ocookie/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odroe%2Focookie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30463558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"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","dart","parser","serializer","set-cookie"],"created_at":"2024-12-29T09:39:16.214Z","updated_at":"2026-03-13T09:02:06.444Z","avatar_url":"https://github.com/odroe.png","language":"Dart","funding_links":["https://github.com/sponsors/medz"],"categories":[],"sub_categories":[],"readme":"# 🍪 Ocookie\n\nCookie and Set-Cookie parser and serializer.\n\n## Installation\n\nTo install `ocookie` add the following to your `pubspec.yaml`\n```yaml\ndependencies:\n  ocookie: latest\n```\n\nAlternatively, you can run the following command:\n```bash\ndart pub add ocookie\n```\n\n## Basic Usage\n\n```dart\nfinal cookie = Cookie('name', 'value');\nprint(cookie.serialize()); // name=value\nprint(Cookie.parse('a=b;b=c')); // {a: b, b: c}\n\nfinal setCookie = Cookie.fromString(\n  'sid=abc; Path=/; HttpOnly; Secure; SameSite=None',\n);\nprint(setCookie.path); // /\n\nfinal values = Cookie.splitSetCookie(\n  'a=b; Expires=Wed, 21 Oct 2015 07:28:00 GMT, c=d; Path=/',\n);\nprint(values); // [a=b; Expires=Wed, 21 Oct 2015 07:28:00 GMT, c=d; Path=/]\n```\n\n### Utils\n\n- `Cookie.serialize` - Serialize a cookie instance to string.\n- `Cookie.validate` - Validate a cookie and return all errors.\n- `Cookie.parse` - Parse client-side `cookie` header map.\n- `Cookie.fromString` - Parse a set-cookie string to Cookie instance.\n- `Cookie.splitSetCookie` - Split a string of multiple set-cookie values into a set-cookie string list.\n\n## CopyWith And Clear\n\n```dart\nfinal original = Cookie(\n  'sid',\n  'abc',\n  path: '/demo',\n  secure: true,\n  sameSite: CookieSameSite.none,\n);\n\nfinal updated = original.copyWith(path: '/next');\nfinal cleared = original.copyWith(\n  clear: {CookieNullableField.path},\n);\n```\n\n## Validation\n\n```dart\nfinal cookie = Cookie(\n  'sid',\n  'abc',\n  sameSite: CookieSameSite.none,\n);\n\nfinal errors = cookie.validate();\nif (errors.isNotEmpty) {\n  print(errors);\n}\n```\n\n## Security Constraints\n\n- `SameSite=None` requires `Secure=true`.\n- `Partitioned=true` requires `Secure=true`.\n\n## Flag Semantics\n\n- `HttpOnly`, `Secure`, and `Partitioned` are two-state flags.\n- Omitting a flag is equivalent to setting it to `false`.\n\n# API Reference\n\nSee the [API documentation](https://pub.dev/documentation/ocookie) for detailed information about all available APIs.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodroe%2Focookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodroe%2Focookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodroe%2Focookie/lists"}