{"id":15491172,"url":"https://github.com/myconsciousness/sweet-cookie-jar","last_synced_at":"2025-04-22T19:12:37.366Z","repository":{"id":40252977,"uuid":"435803568","full_name":"myConsciousness/sweet-cookie-jar","owner":"myConsciousness","description":"Usable cookie management library in Dart. With SweetCookieJar, you can easily manage cookie on your application.","archived":false,"fork":false,"pushed_at":"2024-12-07T10:33:23.000Z","size":40,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T19:12:28.919Z","etag":null,"topics":["cookie","cookie-management","cookiejar","dart","flutter","library","pubdev"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/sweet_cookie_jar","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myConsciousness.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}},"created_at":"2021-12-07T08:40:34.000Z","updated_at":"2024-12-07T10:34:17.000Z","dependencies_parsed_at":"2024-12-07T11:31:16.492Z","dependency_job_id":null,"html_url":"https://github.com/myConsciousness/sweet-cookie-jar","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.21875,"last_synced_commit":"4aeb66d438ada7b1e4eb9d7aa60b8e44dcff3016"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fsweet-cookie-jar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fsweet-cookie-jar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fsweet-cookie-jar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myConsciousness%2Fsweet-cookie-jar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myConsciousness","download_url":"https://codeload.github.com/myConsciousness/sweet-cookie-jar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306640,"owners_count":21408926,"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","cookie-management","cookiejar","dart","flutter","library","pubdev"],"created_at":"2024-10-02T07:44:05.361Z","updated_at":"2025-04-22T19:12:37.341Z","avatar_url":"https://github.com/myConsciousness.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![pub package](https://img.shields.io/pub/v/sweet_cookie_jar.svg)](https://pub.dev/packages/sweet_cookie_jar)\n\n\u003c!-- TOC --\u003e\n\n- [1. About](#1-about)\n  - [1.1. Introduction](#11-introduction)\n    - [1.1.1. Install Library](#111-install-library)\n    - [1.1.2. Import It](#112-import-it)\n    - [1.1.3. Use SweetCookieJar](#113-use-sweetcookiejar)\n\n\u003c!-- /TOC --\u003e\n\n# 1. About\n\n**_Usable cookie management library in Dart_**\n\n`SweetCookieJar` is an open-sourced Dart library.\u003c/br\u003e\nWith `SweetCookieJar`, you can easily manage cookie on your application.\n\n`SweetCookieJar` is a library that extends the functionality of the official [Cookie](https://api.flutter.dev/flutter/dart-io/Cookie-class.html) class. It also works with [Responses](https://pub.dev/documentation/http/latest/http/Response-class.html) in the [http](https://pub.dev/packages/http) package, and even if multiple `set-cookie` are set in the response header, which is a weak point in the [http](https://pub.dev/packages/http) package, `SweetCookieJar` can manage these cookie information very easily!\n\nNo more difficult implementation is needed to handle multiple `set-cookie` set in response header in Dart. Just pass the [Response](https://pub.dev/documentation/http/latest/http/Response-class.html) to the constructor of `SweetCookieJar`!\n\n## 1.1. Introduction\n\n### 1.1.1. Install Library\n\n**_With Dart:_**\n\n```terminal\n dart pub add sweet_cookie_jar\n```\n\n**_With Flutter:_**\n\n```terminal\n flutter pub add sweet_cookie_jar\n```\n\n### 1.1.2. Import It\n\n```dart\nimport 'package:sweet_cookie_jar/sweet_cookie_jar.dart';\n```\n\n### 1.1.3. Use SweetCookieJar\n\n```dart\nimport 'package:sweet_cookie_jar/sweet_cookie_jar.dart';\n\nvoid main() {\n    // The cookie set in the response header\n    // will be extracted by the constructor process.\n    final cookieJar = SweetCookieJar.from(response: response);\n\n    if (cookieJar.isEmpty) {\n        // It means that there is no cookie information\n        // in the response header.\n        return;\n    }\n\n    // You can find cookie by name easily.\n    final cookie = cookieJar.find(name: 'AWSALB');\n    print(cookie.name);\n    print(cookie.value);\n\n    // Also you can get cookie as JSON format.\n    print(cookie.toJson());\n\n    if (cookie.isExpired) {\n        // Do something when cookie is expired.\n        return;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fsweet-cookie-jar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyconsciousness%2Fsweet-cookie-jar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyconsciousness%2Fsweet-cookie-jar/lists"}