Hi, I have problem I copied the function logout from the sitecontroller to my admincontroller
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
but after it logout and clicking the back button, still I can get back to the previous page…but why is it the logout is working in the sitecontroller…in my admincontroller it’s not working
<?php
namespace app\controllers;
use app\models\User;
use Yii;
class AdminsiteController extends \yii\web\Controller
{
public $layout = 'adminmain';
public function actionIndex()
{
if(isset(Yii::$app->session->id)){
return $this->render('index');
}
return $this->redirect(array('site/index'));
}
public function actionTest(){
return $this->render('test');
}
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
}