src/Controller/BaseController.php
public function setSessionAndRedirect($key, $value, $redirectUrl)
    {
        $this->getSession()->set($key, $value);
        return $this->redirect($redirectUrl);
    }
public function setSessionAndRedirect($key, $value, $redirectUrl)
    {
        $this->getSession()->set($key, $value);
        return $this->redirect($redirectUrl);
    }
Sets a session variable and redirects to the URL
@author Taiwo Ladipo <ladipotaiwo01@gmail.com>
@param $key
@param $value
@param $redirectUrl
@return \yii\web\Response