3 See http://railsexpress.de/blog/articles/2005/12/19/roll-your-own-sql-session-store
5 Only Mysql, Postgres and Oracle are currently supported (others work,
6 but you won't see much performance improvement).
10 If you have generated your sessions table using rake db:sessions:create, go to Step 2
12 If you're using an old version of sql_session_store, run
13 script/generate sql_session_store DB
14 where DB is mysql, postgresql or oracle
24 Add the code below after the initializer config section:
26 ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.
27 update(:database_manager => SqlSessionStore)
29 Finally, depending on your database type, add
31 SqlSessionStore.session_class = MysqlSession
34 SqlSessionStore.session_class = PostgresqlSession
36 SqlSessionStore.session_class = OracleSession
38 after the initializer section in environment.rb
42 If you want to use a database separate from your default one to store
43 your sessions, specify a configuration in your database.yml file (say
44 sessions), and establish the connection on SqlSession in
47 SqlSession.establish_connection :sessions
52 1. The class name SQLSessionStore has changed to SqlSessionStore to
53 let Rails work its autoload magic.
55 2. You will need the binary drivers for Mysql or Postgresql.
56 These have been verified to work:
58 * ruby-postgres (0.7.1.2005.12.21) with postgreql 8.1
59 * ruby-mysql 2.7.1 with Mysql 4.1
60 * ruby-mysql 2.7.2 with Mysql 5.0