Session Expire

Hi,

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.

Thanks

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.

Hi,

Please see this link http://www.yiiframework.com/wiki/321/using-loginrequiredajaxresponse-to-solve-ajax-session-timeout/.

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

http://www.yiiframework.com/forum/index.php/topic/12056-doing-special-actoin-on-session-close-expire/ and see my reply at the bottom.