Auto-logout feature

Hi,

For security reasons, I need to turn on an auto-logout feature for my Yii application. I have cookie based authentication enabled, so how can I have a user being redirected to the login page after an inactivity period of eg. 5 minutes?

Thanks.

Set a refresh header:



<meta http-equiv="refresh" content="300;url=http://...">


OK, I had already thought about a Javascript script, the refresh header is a new idea. Thanks. What about the $duration parameter in CWebUser::login()?

I store the session id in a database and have a cronjob running on the db host checking the last access to a page (every page updates a timestamp in t his database for the session each time the user enters it). If the idle time is greater than a preconfigured limit the record is deleted and the next time the user enters a page, as this also checks if the session id is on the table, the user is logged out.