The Ruby on Rails Security Guide on Security, under "2.9 Session Expiry" gives following example code:
class Session < ApplicationRecord
def self.sweep(time = 1.hour)
if time.is_a?(String)
time = time.split.inject { |count, unit| count.to_i.send(unit) }
end
delete_all "updated_at < '#{time.ago.to_s(:db)}'"
end
end
How do I connect the model to Devise / to the Devise SessionController? Will Devise use the model? Will it do so automatically or are further steps necessary? Isn't this example specific to Rails' own cookie/session management? If so, what would be the proper complement with Devise / Warden?