No commit activity in last 3 years
No release in over 3 years
This gem allows you to automatically remove old sessions from your ActiveRecord.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0

Runtime

~> 0.9
 Project Readme

activerecord_session_cleaner Gem Version Build Status

Gem to remove old sessions from your ActiveRecord DB.

Installation

In your Gemfile, add:

gem 'activerecord_session_cleaner'

Features

  • Delete all sessions
  • Delete sessions not updated in the last $x days
  • Setup cleanup cron to delete old sessions

Tasks

# Delete old sessions from an Active Record session store
rake activerecord_session_cleaner:cleanup:old[days_to_keep]
# Delete all session from an Active Record session store
rake activerecord_session_cleaner:cleanup:all

# Setup/update cron for session cleanup
rake activerecord_session_cleaner:crontab:update[application_name,days_to_keep]
# Remove cleanup cron for session cleanup
rake activerecord_session_cleaner:crontab:clear[application_name]

Default values:

  • days_to_keep: 10
  • application_name: basename of the current working directory (example if you are in /home/gooby/example)

License

activerecord_session_cleaner is released under the MIT License. See LICENSE.txt for further details.