From f66f1441ae9c8db607fd11e6be0968c408827887 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 30 Jul 2007 23:06:31 +0000 Subject: [PATCH 1/1] Switch to storing sessions in the database. --- config/environment.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/environment.rb b/config/environment.rb index d3c68ca69..3c2516ec7 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -42,7 +42,14 @@ Rails::Initializer.run do |config| # Use the database for sessions instead of the file system # (create the session table with 'rake db:sessions:create') - # config.action_controller.session_store = :active_record_store + # config.action_controller.session_store = :sql_session_store + + # Unfortunately SqlSessionStore is a plugin which has not been + # loaded yet, so we have to do things the hard way... + config.after_initialize do + ActionController::Base.session_store = :sql_session_store + SqlSessionStore.session_class = MysqlSession + end # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, -- 2.43.2