views:

168

answers:

1

I'm running into a CookieOverflow error, so I want to switch to database sessions.

In config/environment.rb:

Uncommented: config.action_controller.session_store = :active_record_store
Changed:  :secret for config.action_controller.session

In application.rb:

Uncommented: protect_from_forgery :secret => 'ac44a970c0047c1b049c1967986af674'

I ran some 'rake ...' commands it told me to, and it created this database table:

CREATE TABLE `sessions` (
`id` int(11) NOT NULL auto_increment,
`session_id` varchar(255) NOT NULL,
`data` text,
`created_at` datetime default NULL,
`updated_at` datetime default NULL,
PRIMARY KEY  (`id`),
KEY `index_sessions_on_session_id` (`session_id`),
KEY `index_sessions_on_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Now, that seems all good and done. BUT it never writes any sessions to the database. Logins still work though. What else do I have to do to make this work? How is this even working if it's using active record sessions and not writing any session data to the database...?

Is there an easy way to step through/troubleshoot this?

A: 

Make sure that you don't have cookie sessions enabled in development.rb (or whatever environment you're running this in). After that, please post your sessions controller.

jdl