Hi!
I’ve got a page that would redirect the user to another URL if that’s logged in. I’d like to use CFileCache to render the page faster if the user isn’t logged in.
array(
'COutputCache + index',
'varyByExpression'=>"PUSR()", // PUSR() function returns whether the user logged in
'duration'=>43200, // 12 hours
),
public function actionIndex() {
if (PUSR()) {
$this->redirect(Yii::app()->params->oldHomeUrl);
}
$this->render('index');
}
But it doesn’t redirect the user that logged in. How could I fix this issue?