{"id":32306568,"url":"https://github.com/egefeyzioglu/cookie_store","last_synced_at":"2026-04-18T06:01:09.012Z","repository":{"id":204407423,"uuid":"711782440","full_name":"egefeyzioglu/cookie_store","owner":"egefeyzioglu","description":"A Cookie management plugin for HTTP/HTTPS connections. Parses Set-Cookie headers and generates Cookie headers for requests, in accordance with RFC 6265","archived":false,"fork":false,"pushed_at":"2026-04-18T04:06:22.000Z","size":78,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-18T05:40:55.414Z","etag":null,"topics":["cookie","dart","http"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/cookie_store","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/egefeyzioglu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2023-10-30T07:01:18.000Z","updated_at":"2026-04-18T04:06:24.000Z","dependencies_parsed_at":"2023-11-19T21:41:56.926Z","dependency_job_id":"83ece6d6-5e48-4445-a0fb-dc5319d0b4f0","html_url":"https://github.com/egefeyzioglu/cookie_store","commit_stats":null,"previous_names":["egefeyzioglu/cookie_store"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/egefeyzioglu/cookie_store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egefeyzioglu%2Fcookie_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egefeyzioglu%2Fcookie_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egefeyzioglu%2Fcookie_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egefeyzioglu%2Fcookie_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egefeyzioglu","download_url":"https://codeload.github.com/egefeyzioglu/cookie_store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egefeyzioglu%2Fcookie_store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31958467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","http"],"created_at":"2025-10-23T07:05:09.972Z","updated_at":"2026-04-18T06:01:09.006Z","avatar_url":"https://github.com/egefeyzioglu.png","language":"Dart","readme":"# Cookie Store\n\n[![Dart Tests](https://github.com/egefeyzioglu/cookie_store/actions/workflows/dart-tests.yml/badge.svg)](https://github.com/egefeyzioglu/cookie_store/actions/workflows/dart-tests.yml) [![Dart Analyze](https://github.com/egefeyzioglu/cookie_store/actions/workflows/dart-analyze.yml/badge.svg)](https://github.com/egefeyzioglu/cookie_store/actions/workflows/dart-analyze.yml)\n\nA Cookie management plugin for HTTP/HTTPS connections.\n\nParses Set-Cookie headers and generates Cookie headers for requests, in accordance with RFC 6265[^1].\n\n## Usage\n\nInitialise a cookie store\n\n```dart\nCookieStore cookieStore = new CookieStore();\n```\n\nWhen you get a Set-Cookie header, pass it to the cookie store after stripping the \"Set-Cookie:\" portion\n\n```dart\nfor(header in responseHeaders){\n    if(header.key == \"Set-Cookie\"){\n        cookieStore.updateCookies(header.value, requestDomain, requestPath);\n    }\n    //...\n}\n```\n\nWhen you're making a request, either get the cookies and add them to your request\n\n```dart\nfinal String domain = \"example.com\"\nfinal String path = domain + \"/api/whatever\";\n\nList\u003cCookie\u003e cookies = cookieStore.getCookiesForRequest(domain, path);\n\n// Add cookies to your request in some custom way\n// Send request\n```\n\nor have the cookie store build the header for you\n\n```dart\nfinal String domain = \"example.com\"\nfinal String path = domain + \"/api/whatever\";\n\nString cookieHeader = CookieStore.buildCookieHeader(\n  cookieStore.getCookiesForRequest(domain, path));\n\n// Send request\n```\n\nWhen you're done with the current session, call the `onSessionEnded()` method. What this means is up to you. On a browser, it usually means when all tabs from that domain are closed.\n\nIf the cookie storage is taking up too much memory, you may call the `reduceSize(numCookies, force)` method to shrink the cookie storage. This will try to clean up any expired or excessive cookies and return true if successful. See the method documentation for more details.\n\n### The `Cookie` object\nThe `Cookie` object has a fairly simple structure:\n\n```dart\nclass Cookie {\n  String name;\n  String value;\n  DateTime? expiryTime;\n  String domain = \"\";\n  late String path;\n  DateTime creationTime;\n  DateTime lastAccessTime;\n  bool persistent = false;\n  bool hostOnly = false;\n  bool secure = false;\n  bool httpOnly = false;\n\n  Cookie(\n    this.name,\n    this.value, {\n    DateTime? creationTime,\n    DateTime? lastAccessTime,\n  })  : creationTime = creationTime ?? DateTime.now(),\n        lastAccessTime = lastAccessTime ?? DateTime.now();\n}\n```\n\n## Acceptable date formats\n\nThis library is very permissive with respect to parsing date formats provided by the server. The following are acceptable formats:\n\n- RFC 6265\n  - `23:59:59 1 jan 1970`\n  - `23:59:59 1 jan 70`\n- HTTP ([RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-3.3.1))\n  - `Thu, 1 Jan 1970 23:59:59 GMT`\n  - `Thursday, 1-Jan-1970 23:59:59 GMT`\n  - `Thu Jan  1 23:59:59 1970`\n- Incorrect HTTP ([RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-3.3.1), but with the wrong style day of week)\n  - `Thursday, 1 Jan 1970 23:59:59 GMT`\n  - `Thu, 1-Jan-1970 23:59:59 GMT`\n  - `Thursday Jan  1 23:59:59 1970`\n\n  \n[^1]: Well, kind of. The internet is an awful, awful place where literally nobody abides by RFC's so this library is _very_ persmissive, especially with respect to date parsing. It is guaranteed, however, that an RFC 6265-compliant server will work correctly with this library. Please see [above](#acceptable-date-formats) for the date formats that are allowed. If your server (or a server you want to talk to) uses another form of nonstandard date format, please create an issue or a pull request. I will try to implement it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegefeyzioglu%2Fcookie_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegefeyzioglu%2Fcookie_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegefeyzioglu%2Fcookie_store/lists"}