{"id":15288777,"url":"https://github.com/mongoid/mongo_session_store","last_synced_at":"2025-10-08T17:14:29.397Z","repository":{"id":787586,"uuid":"483678","full_name":"mongoid/mongo_session_store","owner":"mongoid","description":"MongoSessionStore is a Rails-compatible session store for MongoDB using either Mongoid or the MongoDB Ruby Driver. It also allows for custom Mongo session store that works with any (or no!) Mongo ODM","archived":false,"fork":false,"pushed_at":"2022-03-09T14:29:09.000Z","size":303,"stargazers_count":56,"open_issues_count":6,"forks_count":92,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T21:03:47.276Z","etag":null,"topics":["mongodb","mongoid","rails","ruby","session-management","session-storage","sessions"],"latest_commit_sha":null,"homepage":"http://mongoid.github.io/","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/mongoid.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":"2010-01-22T11:00:01.000Z","updated_at":"2023-12-08T22:16:38.000Z","dependencies_parsed_at":"2022-07-05T15:00:26.125Z","dependency_job_id":null,"html_url":"https://github.com/mongoid/mongo_session_store","commit_stats":null,"previous_names":["nmerouze/mongo_session_store"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoid%2Fmongo_session_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoid%2Fmongo_session_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoid%2Fmongo_session_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoid%2Fmongo_session_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongoid","download_url":"https://codeload.github.com/mongoid/mongo_session_store/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256110,"owners_count":20909240,"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":["mongodb","mongoid","rails","ruby","session-management","session-storage","sessions"],"created_at":"2024-09-30T15:53:09.373Z","updated_at":"2025-10-08T17:14:24.343Z","avatar_url":"https://github.com/mongoid.png","language":"Ruby","readme":"# MongoSessionStore\n\n[![Build Status](https://travis-ci.org/mongoid/mongo_session_store.svg?branch=master)](https://travis-ci.org/mongoid/mongo_session_store)\n[![Gem Version](https://badge.fury.io/rb/mongo_session_store.svg)](http://badge.fury.io/rb/mongo_session_store)\n[![Code Climate](https://codeclimate.com/github/mongoid/mongo_session_store/badges/gpa.svg)](https://codeclimate.com/github/mongoid/mongo_session_store)\n\n## Description\n\nMongoSessionStore is a [Rails][rails]-compatible session store for\n[MongoDB][mongodb] using either [Mongoid][mongoid] or the [MongoDB Ruby\nDriver][mongo]. It also allows for custom Mongo session store that works with\nany (or no!) Mongo ODM.\n\nMongoSessionStore version 3 is compatible with Rails 4.0 through 5.2. For Rails\n3 support please check out issue [#17][issue-rails3] for options and let us\nknow if you need support.\n\n## Installation\n\nAdd the `mongo_session_store` gem to your `Gemfile`.\nUse either the `mongo` or `mongoid` gems in combination with this gem.\n\n```ruby\n# Gemfile\n\ngem \"mongoid\"\n# or gem \"mongo\"\ngem \"mongo_session_store\"\n```\n\nConfigure the session store in the session_store initializer in your Rails\nproject.\n\n```ruby\n# config/initializers/session_store.rb\n\n# Mongoid\nMyApp::Application.config.session_store :mongoid_store\n\n# MongoDB Ruby Driver/anything else\nMongoStore::Session.database = Mongo::Client.new([\"127.0.0.1:27017\"], database: \"my_app_development\")\nMyApp::Application.config.session_store :mongo_store\n```\n\n## Configuration\n\nBy default, the sessions will be stored in the \"sessions\" collection in\nMongoDB. If you want to use a different collection, you can set that in the\nsession_store initializer.\n\n```ruby\n# config/initializers/session_store.rb\nMongoSessionStore.collection_name = \"client_sessions\"\n```\n\n## Usage\n\nBy default nothing has to be done outside the [installation](#installation) of\nthe gem.\n\nIt's possible to query your sessions.\n\n```ruby\n# Mongoid\nMongoidStore::Session.where(:updated_at.gt =\u003e 2.days.ago)\n\n# MongoDB Ruby Driver\nMongoStore::Session.where(\"updated_at\" =\u003e { \"$gt\" =\u003e 2.days.ago })\n```\n\n## Development\n\n### Testing\n\nTo run the tests for a specific store. You must first set a `BUNDLE_GEMFILE` in\nthe environment.\n\n```sh\nbundle exec rake\n```\n\nExamples:\n\n```sh\nBUNDLE_GEMFILE=gemfiles/rails-4.0-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-4.0-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-4.1-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-4.1-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-4.2-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-4.2-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.0-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.0-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.1-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.1-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.2-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-5.2-mongoid.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile bundle exec rake\nBUNDLE_GEMFILE=gemfiles/rails-6.0-mongoid.gemfile bundle exec rake\n```\n\n### Performance benchmark\n\nThe repository includes a performance benchmark. It runs against all available\nincluded stores and outputs the results.\n\n```\nbundle exec ruby perf/benchmark.rb\n```\n\n### Releases\n\nTo create a new release checkout the `master` branch and make sure it's in the\nright state to release. Run the `release` Rake task and follow the\ninstructions.\n\n```\nbundle exec rake release\n```\n\n## Contributors\n\nMongoSessionStore started as a fork of the DataMapper session store, modified\nto work with MongoMapper, Mongoid and the Mongo Ruby Driver.\n\nMuch thanks to all contributors:\n\n* Nicolas Mérouze\n* Chris Brickley\n* Tony Pitale\n* Nicola Racco\n* Matt Powell\n* Ryan Fitzgerald\n* Brian Hempel\n* Tom de Bruijn\n\n## License\n\nReleased under the MIT license. See the [LICENSE](LICENSE) file.\n\n[mongodb]: https://www.mongodb.com/\n[mongo]: https://github.com/mongodb/mongo-ruby-driver\n[mongoid]: http://mongoid.org/\n[rails]: http://rubyonrails.org/\n\n[issue-rails3]: https://github.com/mongoid/mongo_session_store/issues/17\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoid%2Fmongo_session_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongoid%2Fmongo_session_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoid%2Fmongo_session_store/lists"}