ref: refs/heads/master
commit 10e4f21c139814a0a0baca335d367d34865daf8c
Author: Klaus Kämpf
Date: Mon Jul 13 16:05:04 2009 +0200
Move session store to database
Somehow, the cookie (base64 encoded?!) is ~8k in size. Having the
session store in the database is a workaround. The real fix is to make
the session size smaller.
---
webclient/config/environment.rb | 2 +-
.../db/migrate/20090713135755_create_sessions.rb | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/webclient/config/environment.rb b/webclient/config/environment.rb
index b8e3ea1..35266e4 100644
--- a/webclient/config/environment.rb
+++ b/webclient/config/environment.rb
@@ -55,7 +55,7 @@ init = Rails::Initializer.run do |config|
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
- # config.action_controller.session_store = :active_record_store
+ config.action_controller.session_store = :active_record_store
# 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,
diff --git a/webclient/db/migrate/20090713135755_create_sessions.rb b/webclient/db/migrate/20090713135755_create_sessions.rb
new file mode 100644
index 0000000..4ccc353
--- /dev/null
+++ b/webclient/db/migrate/20090713135755_create_sessions.rb
@@ -0,0 +1,16 @@
+class CreateSessions < ActiveRecord::Migration
+ def self.up
+ create_table :sessions do |t|
+ t.string :session_id, :null => false
+ t.text :data
+ t.timestamps
+ end
+
+ add_index :sessions, :session_id
+ add_index :sessions, :updated_at
+ end
+
+ def self.down
+ drop_table :sessions
+ end
+end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org