E
E
EVOSandru62015-08-18 11:37:26
Yii
EVOSandru6, 2015-08-18 11:37:26

Why can Yii::app()->request->urlReferrer be empty in yii?

Good afternoon,
I put the following construction into the controller action (users/registration):

if(!$role || ($role < 1 || $role > 2))
        {

            Yii::app()->user->setFlash('error','Пожалуйста укажите роль');
            die(Yii::app()->request->urlReferrer);
            $this->redirect(Yii::app()->request->urlReferrer);
        }

Yii::app()->request->urlReferrer didn't return the URL of the page I came from, what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pavlenko, 2015-08-18
@Akdmeh

The client is not obliged to give you his Referrer, this is "voluntary" information.
If you open a bookmarked page or open a new tab, there may not be a referrer.
Or the browser just "wanted".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question