Skip to content

hybrid session store that combines rails' built-in cookie based session store with its database backed one

Notifications You must be signed in to change notification settings

ahoward/candy_store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

NAME
  CandyStore

SYNOPSIS
  hybrid session store that combines rails' built-in cookie based session
  store with its database backed one

    session              # normal rails' cookie based session
    session.flash        # same as above 
    session.server       # this one lives in the db 
    session.server.flash # this one lives in the db too

URI
  http://github.com/ahoward/candy_store

USAGE

  1) drop this file in lib/candy_store.rb

  2) run the migration to create the database table

     . rake db:sessions:create
     . rake db:migrate

  3) create config/initializers/session_store.rb with contents like 

       ActionController::Base.session_store = CandyStore

     (or put that in config/environment.rb)

  4) use sessions normally.  if you need to store large items or otherwise
  want to put some infomation in the db use

      session.server
      session.server.flash

  that's it!

About

hybrid session store that combines rails' built-in cookie based session store with its database backed one

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages