Session Expire


i developed a admin panel in yii and that is working fine but when session expired it will not redirect to login page,

Please any one can tell me how i will achieve that in yii properly.


You must use rules() method with accessControl() then DENY access to ANONYMOUS (?) or all users (*) and grant to role admin. That way if your user is anonymous it will be redirected to login, else he will see 403 Forbidden.


Please see this link

You may use it if you have ajax functions.

You may also use <meta http-equiv="refresh" content="30"> having the content of the timeout that you configure so that the page will refresh upon the session expire. Be sure also that you have configured your rules so that it will be redirected to the right page that you want.

If ever you want do some scripts when the user closed the browser without signing out. You may use this link and see my reply at the bottom.