Rails certainly support session database storage support.
In config / environment.rb, uncomment
Examination of \ actionpack-2.2.2 \ lib \ action_controller \ session \ active_record_store.rb shows that CGI :: Session :: ActiveRecordStore :: Session inherits from ActiveRecord :: Base.
So, at the end of config / environment.rb you should be able to say
CGI::Session::ActiveRecordStore::Session.establish_connection( :adapter => "mysql", :host => "otherserver", :username => "session_user", :password => "123ABC", :database => "sessions")
or
CGI::Session::ActiveRecordStore::Session.establish_connection(:sessions)
use the connection defined in config / database.yml
For example, add to config / database.yml:
sessions_development: adapter: mysql host: otherserver username: sessions_user password: 123ABC database: sessions
Add config / environment.rb to the end
CGI::Session::ActiveRecordStore::Session.establish_connection("sessions_#{RAILS_ENV}")
Samuel
source share