yii后台设置,和前台不同的session前缀和,登录地址

//为后台登录管理员设置session名字前缀信息
        Yii::app()->setComponents(array(
            'user'=>array(
                'stateKeyPrefix' =>'seller',
                'loginUrl'=>array('seller/default/login'),
            )
        ));

public function init()
    {
        // this method is called when the module is being created
        // you may place code here to customize the module or the application

        // import the module-level models and components
        $this->defaultController = 'User';
        $this->setImport(array(
            'admin.models.*',
            'admin.components.*',
        ));

        //为后台登录管理员设置session名字前缀信息
        Yii::app()->setComponents(array(
            'user'=>array(
                'stateKeyPrefix' =>'houtai',
                'loginUrl'=>array('admin/default/login'),
            )
        ));
    }
posted @ 2014-08-31 15:29  半醉半醒201  阅读(486)  评论(1编辑  收藏  举报