Skip to content
A simple session store for Rails based on Redis.
Ruby
Find file
Pull request Compare This branch is 4 commits ahead of bendyworks:master.
Latest commit a9569e4 @nickyp Merge pull request #1 from janminarik/master
There is one more parameter to set session in Rails 3.1
Failed to load latest commit information.
lib options are given to set_session in fourth parameter in Rails 3.1
.gitignore Add .rvmrc to .gitignore
LICENSE Initial commit. And it works!
README.md updated README with proper Rails 3 configuration snippet
Rakefile Breaks redis 1 compat, uses multi instead of pipelined
VERSION bumped version + gemspec to avoid version conflict with elisehuard/re…
rails3-redis-session-store.gemspec Breaks redis 1 compat, uses multi instead of pipelined
rails3-redis2-session-store.gemspec

README.md

A simple Redis-based session store for Redis. But why, you ask, when there's redis-store? redis-store is a one-fits-all solution, and I found it not to work properly with Rails, mostly due to a problem that seemed to lie in Rack's Abstract::ID class. I wanted something that worked, so I blatantly stole the code from Rails' MemCacheStore and turned it into a Redis version. No support for fancy stuff like distributed storage across several Redis instances. Feel free to add what you seem fit.

This library doesn't offer anything related to caching, and is only suitable for Rails applications. For other frameworks or drop-in support for caching, check out redis-store

Installation

gem install rails3-redis-session-store

Configuration

See lib/redis-session-store.rb for a list of valid options. In your Rails app, throw in an initializer with the following contents and the configuration above:

YourApp::Application.config.session_store :redis_session_store,
                                          :db => 0,
                                          :expire_after => 10.minutes,
                                          :key_prefix => "your_app:session:"
Something went wrong with that request. Please try again.