3 require File.dirname(__FILE__) + '/../config/environment'
5 Session.find(:all, :conditions => ["updated_at < ?", 1.week.ago]).each do |session|
7 if session[:user] and User.find(session[:user])
8 session.destroy if session.updated_at < 1.month.ago
12 rescue Exception => ex
13 puts "Invalid session #{session.session_id}: #{ex.to_s}"
18 UserToken.delete_all("expiry < NOW()")