The following line no longer works in 2.3: ActiveRecord::SessionStore.delete_all ['updated_at < ?', 24.hours.ago] Does anyone know how to do this in 2.3? Thanks, Jay
on 2009-03-19 14:42
on 2009-03-19 15:07
Jay wrote: > The following line no longer works in 2.3: > > ActiveRecord::SessionStore.delete_all ['updated_at < ?', 24.hours.ago] > > Does anyone know how to do this in 2.3? Do you really need to go though Rails to do this? I think I would just write a simple script and execute it in a cron task to clear out old sessions. As far as I can tell, as long as the sessions fit the criteria for cookie based session stores, it seems to me like a very clean way to deal session data. That way the server and database are relieved from the burden of dealing with sessions. I am also looking forward to the day when it becomes feasible to use HTML 5.0 local storage to keep session data. I believe this will be the final solution to dealing with persistent data for web applications. It eliminates the current limitations of cookie based sessions while simultaneously pushing state related information out to the client-side where, IMHO, it belongs.
on 2009-03-19 15:51
Ouch, you're right ! I've the same problem, I watch the API and solved ! Try this: ActiveRecord::SessionStore::Session.delete_all ['updated_at < ?', 24.hours.ago] Have fun !