yii\web\User::setReturnUrl PHP Method

setReturnUrl() public method

Remembers the URL in the session so that it can be retrieved back later by User::getReturnUrl.
public setReturnUrl ( string | array $url )
$url string | array the URL that the user should be redirected to after login. If an array is given, [[UrlManager::createUrl()]] will be called to create the corresponding URL. The first element of the array should be the route, and the rest of the name-value pairs are GET parameters used to construct the URL. For example, ```php ['admin/index', 'ref' => 1] ```
    public function setReturnUrl($url)
    {
        Yii::$app->getSession()->set($this->returnUrlParam, $url);
    }