YII_DEBUG false redirect

Hi, I have a problem, if YII_DEBUG is true this run good but this is false not.

[size="4"]index.php[/size]




  defined('YII_DEBUG') or define('YII_DEBUG', false);



[size="4"]controller.php[/size]

[size="2"][b]

[/b][/size]


   public function actions()

    { 

            $Control=new Control;

            if(!$Control->checkControl())

            {

                return $this->redirect(['/login/index']);

            }  

            $this->layout = 'main';   

        

        return [

            'error' => [

                'class' => 'yii\web\ErrorAction',

            ],

            'captcha' => [

                'class' => 'yii\captcha\CaptchaAction',

                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,

            ],

        ];

    }

If yii debug is true correct redirect but if is false the web page is white and code 500

CheckControl is a function that check if is guest

The problem is when the user lost session or if I destroy session(only this case).