Yii return to previus page after login

Hello, guys can you tell me

  1. how to set the user returnUrl in main.php config in general

  2. how to set the user returnUrl to be a page that I visited before login




// application components

	'components'=>array(

		'user'=>array(

			// enable cookie-based authentication

			'allowAutoLogin'=>true,

                        'returnUrl'=>'some url',

		),

),



more info: http://www.yiiframework.com/doc/api/1.1/CWebUser#returnUrl-detail

Use $_SERVER[‘HTTP_REFERER’] (I am not sure how reliable it is thou) and redirect to it after successful login

Thank you but it is not working. I have this code:


	'components'=>array(

		

[.........]

		

		'user'=>array(

			// enable cookie-based authentication

			'allowAutoLogin'=>true,

			'autoRenewCookie' => true,

			'returnUrl' => 'google.com',

		),

so after login it redirects to "example.com/index.php"