{"id":17256629,"url":"https://github.com/princemaple/cookie_jar","last_synced_at":"2025-07-23T09:08:51.468Z","repository":{"id":17252533,"uuid":"81504954","full_name":"princemaple/cookie_jar","owner":"princemaple","description":"CookieJar stores your cookies and applies them to future requests","archived":false,"fork":false,"pushed_at":"2025-05-30T04:37:39.000Z","size":118,"stargazers_count":14,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T10:43:34.633Z","etag":null,"topics":["cookie","elixir","http"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/cookie_jar","language":"Elixir","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/princemaple.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}},"created_at":"2017-02-09T23:22:51.000Z","updated_at":"2025-05-30T04:36:48.000Z","dependencies_parsed_at":"2024-04-16T17:41:35.813Z","dependency_job_id":"9fbdd6da-729b-4d9f-8bb1-282df6d62c71","html_url":"https://github.com/princemaple/cookie_jar","commit_stats":{"total_commits":125,"total_committers":10,"mean_commits":12.5,"dds":0.5680000000000001,"last_synced_commit":"d52d5da32158fe58571411895014684805568460"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/princemaple/cookie_jar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princemaple%2Fcookie_jar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princemaple%2Fcookie_jar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princemaple%2Fcookie_jar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princemaple%2Fcookie_jar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princemaple","download_url":"https://codeload.github.com/princemaple/cookie_jar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princemaple%2Fcookie_jar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266649206,"owners_count":23962190,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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","elixir","http"],"created_at":"2024-10-15T07:14:54.673Z","updated_at":"2025-07-23T09:08:51.440Z","avatar_url":"https://github.com/princemaple.png","language":"Elixir","readme":"# CookieJar\n\n[![hex.pm version](https://img.shields.io/hexpm/v/cookie_jar.svg?style=flat)](https://hex.pm/packages/cookie_jar)\n[![API Docs](https://img.shields.io/badge/api-docs-blue.svg?style=flat)](https://hexdocs.pm/cookie_jar/)\n\n![COOKIE JAR](https://cloud.githubusercontent.com/assets/1329716/22807691/5fe454d6-ef7c-11e6-8e0b-30aca685c83a.jpg)\n\n## Installation\n\nThe package can be installed\nby adding `cookie_jar` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:cookie_jar, \"~\u003e 1.0\"}]\nend\n```\n\n## Usage\n\n1. Add alias (optional)\n\n```elixir\nalias CookieJar.HTTPoison, as: HTTPoison\n```\n\n2. Get a cookie jar\n\n```elixir\n{:ok, jar} = CookieJar.new\n```\n\nAlternatively, you can use a permenent cookie jar by starting one as part of your supervision tree:\n\n```elixir\ndef start(_type, _args) do\n  children = [\n  {CookieJar.Server, name: MyApp.CookieJar},\n  ...\n```\n\nThen you can use `MyApp.CookieJar` as the application-wide jar.\n\n3. Shove the jar into all http calls\n\n```diff\n- HTTPoison.get(\"https://example.com/api/call\")\n+ HTTPoison.get(jar, \"https://example.com/api/call\")\n```\n\n4. Profit (cookies imprisoned)\n   All cookies from \"Set-Cookie:\" response headers are now stored in the jar and will be automatically sent back through \"Cookie:\" request headers. CookieJar respect the following attributes in the cookies:\n\n- Domain: To limit abuses, CookieJar only allows `Domain` to be set to the current hostname of the request or its immediate parent domain.\n- Path: A cookie can limit the sending back to part of the path tree in the request\n- Secure: A secure cookie can only be set by https responses and used by https requests\n- Max-Age: A cookie can specify its max age\n\nAll other attributes are silently ignored.\n\n**Take a look at [the docs](https://hexdocs.pm/cookie_jar)**\n\n- [How to directly use CookieJar](https://hexdocs.pm/cookie_jar/CookieJar.html#content)\n- [HTTPoison adapter](https://hexdocs.pm/cookie_jar/CookieJar.HTTPoison.html#content)\n- [HTTPotion adapter](https://hexdocs.pm/cookie_jar/CookieJar.HTTPotion.html#content)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincemaple%2Fcookie_jar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincemaple%2Fcookie_jar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincemaple%2Fcookie_jar/lists"}