Blog Post RSS ?

Blogs » Ruby on Rails » Clean your sessions
 

Clean your sessions

by Daniel Bogan

By default, Rails doesn’t nuke expired sessions from your app’s storage of choice (either PStores/files or rows in a database table, usually). On my personal site, there’s just under a million entries in the session table alone – somewhat of a waste as it keeps building over time.

To counter this, you can implement this handy code snippet via a Cron job (or run it manually if you don’t have access to Cron or similar tools, you poor poor bastich).

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

This post has one response so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...