Calling custom method before session auto destroy

Hi All,

Is there any way to call a custom method before session gets auto/mannual destroyed?

My problem is, I am capturing user logout time in the DB. Its working fine when user gets logout manually (By calling logout method) but I am not able to capture logout time when user’s session gets auto destroyed after timeout.

Appreciate any solution to this.

I think this is very hard, for example, on Ubuntu Linux the session data that has exceeded it’s lifetime are deleted every 30 minutes as a cronjob (/etc/cron.d/php5)