Skip to content

Instantly share code, notes, and snippets.

@roidrage
Created June 7, 2009 18:32
Show Gist options
  • Save roidrage/125421 to your computer and use it in GitHub Desktop.
Save roidrage/125421 to your computer and use it in GitHub Desktop.
# Yes, I'm still using database session, and for good reason.
class SessionCleaner
def self.remove_stale_sessions
ActiveRecord::SessionStore::Session.
delete_all( ['updated_at < ?', 1.week.ago] )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment