SQL Session Store plugin

Plugin details

Provides much better performance than the default ActiveRecordStore shipping with Rails.

Websitehttp://railsexpress.de/blog/articles/2006/09/15/sqlsessionstore-now-available-as-a-plugin Repositoryhttp://railsexpress.de/svn/plugins/sql_session_store/trunk/ Author Stefan Kaes Tags session, sql, store LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://railsexpress.de/svn/plugins/sql_session_store/trunk/

Step 1
=========

If you have generated your sessions table using rake db:sessions:create, go to Step 2

If you're using an old version of sql_session_store, run

    script/generate sql_session_store DB


where DB is mysql, postgresql or oracle

Then run

    rake migrate


or

    rake db:migrate


for edge rails.

Step 2
=========

Add the code below after the initializer config section:

    ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.
      update(:database_manager => SqlSessionStore)


Finally, depending on your database type, add

    SqlSessionStore.session_class = MysqlSession


or

    SqlSessionStore.session_class = PostgresqlSession


or

    SqlSessionStore.session_class = OracleSession



after the initializer section in environment.rb

Step 3 (optional)
===============

If you want to use a database separate from your default one to store your sessions, specify a configuration in your database.yml file (say sessions), and establish the connection on SqlSession in environment.rb:

   SqlSession.establish_connection :sessions

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 9 months ago