会话超时后重定向到登录页面yii

时间:2017-12-14 08:10:29

标签: session authentication yii

我希望在会话结束后重定向我的网站。我试过这段代码:

 'user' => array(
            // enable cookie-based authentication
            'class' => 'application.components.WebUser',
            'allowAutoLogin' => true,
            'returnUrl' => array('site/index'),
            'authTimeout'=>5,
         ),

此代码结束我的会话,但它没有重定向到我的登录页面。这只是发给我一个错误,告诉我Property "WebUser.username" is not defined.。会话结束后如何将其重定向到我的登录页面?我还是在使用Yii。

我的网络用户代码

public function __get($name)
    {
        if($this->hasState($name))
            return $this->getState($name);
        else
            return parent::__get($name);
    }

0 个答案:

没有答案