And if it's for a multi-server web farm, you're way better off with sticky sessions on the load balancer than a shared persistent session store. And if you can't afford to ever lose any of the data you're currently saving in session even in the rare event of server fail over, you should be taking the performance hit and associating that to a persistent user profile in the database.
Best Wishes, Peter On May 26, 2011, at 11:08 AM, Peter De Berdt 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. > > 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. -- 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.

