Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple session store for Rails based on Redis.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 redis-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 redis-session-store

Configuration

See lib/redis-session-store.rb for a list of valid options. Set them using:

ActionController::Base.session = {
  :db => 2,
  :expire_after => 120.minutes,
  :key_prefix => "myapp:session:"
}

In your Rails app, throw in an initializer with the following contents and the configuration above:

ActionController::Base.session_store = RedisSessionStore
Something went wrong with that request. Please try again.