Module based login


(Sorry for my bad English, but I am from France and trying my best)

I have a webApplication with an admin module.

We can login in the admin module or on the website, but the two logins are completely independant. I think that it was working before, but now, when I go to index.php?r=admin, I am redirected to index.php?r=site/login instead of index.php?r=admin/index/login. And when I loggin on the website, I can access the admin interface like if I was logged in.

Here is my config/main.php


return array(

	// autoloading model and component classes












	// application components



			// enable cookie-based authentication





			// use 'site/error' action to display errors





And here is the AdminModule.php


class AdminModule extends CWebModule


	public $defaultController = 'index';


	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







			'user' => array(

				'class'          => 'CWebUser',

				'stateKeyPrefix' => 'admin',

				'loginUrl'       => Yii::app()->createUrl('/admin/index/login'),







	public function beforeControllerAction($controller, $action)


		if(parent::beforeControllerAction($controller, $action))


			// this method is called before any module controller action is performed

			// you may place customized code here

			return true;



			return false;



I only use basic login form and user identities.

So if you have any idea of what I could be missing, it would be a great help

Thanks !!