{"id":16326623,"url":"https://github.com/izolate/shelf-cookie","last_synced_at":"2025-10-25T20:32:05.633Z","repository":{"id":54110951,"uuid":"201666754","full_name":"izolate/shelf-cookie","owner":"izolate","description":"Cookie parser middleware for Shelf (Dart)","archived":false,"fork":false,"pushed_at":"2021-03-09T08:04:22.000Z","size":15,"stargazers_count":4,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T10:35:50.512Z","etag":null,"topics":["cookie-parser","cookies","dart","middleware","sessions","shelf"],"latest_commit_sha":null,"homepage":"","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/izolate.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}},"created_at":"2019-08-10T18:13:15.000Z","updated_at":"2024-11-16T20:19:19.000Z","dependencies_parsed_at":"2022-08-13T06:50:47.315Z","dependency_job_id":null,"html_url":"https://github.com/izolate/shelf-cookie","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fshelf-cookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fshelf-cookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fshelf-cookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fshelf-cookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izolate","download_url":"https://codeload.github.com/izolate/shelf-cookie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238207648,"owners_count":19434095,"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-parser","cookies","dart","middleware","sessions","shelf"],"created_at":"2024-10-10T23:09:04.049Z","updated_at":"2025-10-25T20:32:05.325Z","avatar_url":"https://github.com/izolate.png","language":"Dart","readme":"# shelf_cookie\n\nCookie parser middleware for the Dart Shelf ecosystem.\nReads cookies in request, sets cookies in response.\n\nAdds a `CookieParser` instance to `request.context['cookies']` to help\nmanipulate cookies.\n\n## Example\n\n```dart\nimport 'dart:io';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'package:shelf_cookie/shelf_cookie.dart';\n\n/// Handle a request that contains a `Cookie` header.\n/// e.g. 'Cookie': 'ping=foo'\nvar handler = const shelf.Pipeline()\n    // initialize cookie parser middleware\n    .addMiddleware(cookieParser())\n    .addHandler((req) async {\n  CookieParser cookies = req.context['cookies'];\n\n  // Retrieve request cookies.\n  var reqCookie = cookies.get('ping');\n  print(reqCookie.name); // foo\n\n  // Clear cookies because Shelf currently only supports\n  // a single `Set-Cookie` header in response.\n  cookies.clear();\n\n  // Create a cookie for response.\n  var resCookie = cookies.set('pong', 'bar', secure: true);\n\n  // Middleware will add `Set-Cookie` response header.\n  // e.g. 'Set-Cookie': 'pong=bar; Secure; HttpOnly'\n  return shelf.Response.ok('OK');\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fshelf-cookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizolate%2Fshelf-cookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fshelf-cookie/lists"}