All.
Is there a method that we can define/override that is guaranteed to be
called whenever a session is destroyed (regardless of how it is
destroyed)?
Thanks,
Wes
All.
Is there a method that we can define/override that is guaranteed to be
called whenever a session is destroyed (regardless of how it is
destroyed)?
Thanks,
Wes
Wes G. wrote:
All.
Is there a method that we can define/override that is guaranteed to be
called whenever a session is destroyed (regardless of how it is
destroyed)?Thanks,
Wes
Sort of, but not really. If you are using ActiveRecordStore you can add
a before_destroy method to your Session model, but you have to delete
the entries with a session_obj.destroy call. If you have a cronjob that
simply runs a
DELETE FROM sessions WHERE updated_at < (some_time_ago)
Then there is no callback, because rails never gets invoked at all.
The problem is that most methods of session cleanup happen without the
rails app even knowing it happened at all.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs