Need Help For Login Page

Hi, im newbie with yii framework. Im trying to make a login function. When user input user and pass, it must direct from site/login to main/index and still keep the log-in status. But I dont know how to do it, please help.

If you look at this login action:

public function actionLogin()



        $model=new LoginForm;


		// if it is ajax validation request

		if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')


			echo CActiveForm::validate($model);



		// collect user input data




			// validate user input and redirect to the previous page if valid

			if($model->validate() && $model->login())



		// display the login form



You can change: $this->redirect(Yii::app()->user->returnUrl); to: $this->redirect(controller/action)

It help me a lot, thank :D