How to get Devise session timeout callback?

devise, ruby-on-rails, ruby-on-rails-3, ruby-on-rails-3.1

Solution

I found that doing Warden.before_logout was the best solution:

# app/models/user.rb

Warden::Manager.before_logout do |user, auth, opts|
  #fdsafdsafdsa
end

Unfortunately, there doesn't seem to be any way to do this with pure Devise.

Problem

Is there a way to get a callback/ process some action when a user's session times out with Devise? The plain old overriding the DeviseSessionsController doesn't work: ``` class SessionsController < Devise::SessionsController def destroy #do something super end end ``` This only works when a user logs out, which makes sense since it doesn't seem like a controller is called on session timeout. Can someone help me out?

Original source