{"id":19684133,"url":"https://github.com/cedarcode/mechanize-cookie_store","last_synced_at":"2025-11-11T20:01:20.575Z","repository":{"id":56883143,"uuid":"126067418","full_name":"cedarcode/mechanize-cookie_store","owner":"cedarcode","description":"A Mechanize extension that allows cookies to be saved in more advanced stores than serialized filesystem files","archived":false,"fork":false,"pushed_at":"2018-04-17T20:03:14.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-26T01:43:26.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/cedarcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-20T18:52:44.000Z","updated_at":"2020-06-18T20:22:35.000Z","dependencies_parsed_at":"2022-08-20T22:31:04.023Z","dependency_job_id":null,"html_url":"https://github.com/cedarcode/mechanize-cookie_store","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/cedarcode%2Fmechanize-cookie_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fmechanize-cookie_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fmechanize-cookie_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedarcode%2Fmechanize-cookie_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedarcode","download_url":"https://codeload.github.com/cedarcode/mechanize-cookie_store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224151084,"owners_count":17264436,"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":[],"created_at":"2024-11-11T18:16:54.973Z","updated_at":"2025-11-11T20:01:15.521Z","avatar_url":"https://github.com/cedarcode.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mechanize::CookieStore\n\n[![Build Status](https://travis-ci.org/cedarcode/mechanize-cookie_store.svg?branch=master)](https://travis-ci.org/cedarcode/mechanize-cookie_store)\n\nmechanize-cookie_store is an extension to [mechanize gem](https://github.com/sparklemotion/mechanize) that allows you to persist the mechanize agent cookie set in a smarter way than serialized or plain files in the server's system. One of its biggest benefits is allowing you to share your cookies across multiple server instances.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mechanize-cookie_store'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mechanize-cookie_store\n\n## Configuration\n\nFor *Rails* applications you can create `config/initializers/mechanize-cookie_store.rb` and provide the necessary\nconfiguration params to access your desired persistance method.\n\nIf you're not using Rails, you just need to make sure to run the same configuration code before using Mechanize.\n\nPlease see below the available built-in stores and their specific configurations:\n\n***Currently, the only supported store is Redis.***\n\n### For Redis\n\n```ruby\nMechanize::CookieStore.configure do |config|\n  config.connection_params = {\n    url: \"your-redis-url\",\n    namespace: \"your-redis-namespace\" # optional\n  }\nend\n```\n\n- `url` must have a valid redis server url\n- `namespace` parameter is optional, default namespace is `mechanize_cookies`\n\n\n## Usage\n\nAfter configuring it, usage looks pretty similar to the way you would use\nmechanize without this gem.\n\nInstantiate a mechanize session and use it:\n\n```ruby\nagent = Mechanize.new\n\nagent.get(\"https://www.google.com\")\n```\n\n\nThen `save` or`load` your cookie_jar the same way you would do it without `mechanize-cookie_store`.\n\n```ruby\nagent.cookie_jar.save # to persist cookies to storage\n\nagent.cookie_jar.load # to load back back into the agent from storage\n```\n\nOr use if you want to load specific cookie set you can pass to `load` the options\n`domain`, `path` and `name` like this:\n\n```ruby\nagent.cookie_jar.load(domain: \"example.com\", path: \"/mypath\", name: \"myCookie\")\n```\n\nPlease note that these options correpond to the fields of the [HTTP::Cookie](https://github.com/sparklemotion/http-cookie/blob/v1.0.3/lib/http/cookie.rb#L27) class, an inherited dependency from Mechanize.\n\n\n## Dependencies\n\nThis gem depends on:\n\n- [Mechanize](https://github.com/sparklemotion/mechanize)\n- [Redis Namespace](https://github.com/resque/redis-namespace)\n\n## Contributing\n\n1. Fork it ( https://github.com/cedarcode/mechanize=cookie_store/ )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\nTo run the test suite, make sure you have Redis server running in `localhost:6379`. Then just run `bundle exec rake`\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Mechanize::CookieStore project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cedarcode/mechanize-cookie_store/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarcode%2Fmechanize-cookie_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedarcode%2Fmechanize-cookie_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarcode%2Fmechanize-cookie_store/lists"}