How to save the user_id in a separate column when using ActiveRecord::SessionStore?


I'm converting my Rails 3.1 app from cookie sessions to database sessions. I've added an extra column on the sessions table to save the user_id.

I read the documentation in ActiveRecord::SessionStore - APIdock and googled but can't seem to find a way to set the session's user_id that works.

Can someone help?


As a work around I'm now saving user_id and session_id's in a separate table. I couln't find a way to write to the sessions table!