On May 26, 4:08 pm, Peter De Berdt <[email protected]> wrote: > On 26 May 2011, at 15:38, Emeka wrote: > > > I would like to have my session be the database stored instead of > > browser. Please, could someone explain to me how to do this? > > http://guides.rubyonrails.org/action_controller_overview.html#session > > However, there's very little to no reason why you would change to the > ActiveRecordStore. The session should not even contain sensitive data > to start off with, that's not what it's made for. It's also not meant > to be used as a garbage can for heaps of data. If that's the reason > why you want to switch to the ActiveRecordStore, then you should stop > for a second and rethink what you are putting in the session and put > it somewhere else.
The one issue i have occasionally had with cookie store is that in the presence of multiple concurrent requests altering the session then with the cookie store these requests tend to destroy each others changes to the session whereas with the database you can at least make a half decent attempt to merge changes (when the requests are changing different keys in the session). Fred > > Also, keep in mind that when you switch to the ActiveRecordStore: > - You will need to clean the expired sessions on regular intervals > yourself > - You will be hitting the database a lot more often on every request, > a waste of server resources in my opinion > > Best regards > > Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

