{"action":"opened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9776","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9776/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9776/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9776/events","html_url":"https://github.com/yiisoft/yii2/issues/9776","id":108541038,"number":9776,"title":"Pjax and Controller::goBack()/returnUrl issues","user":{"login":"harman83in","id":285411,"avatar_url":"https://avatars.githubusercontent.com/u/285411?v=3","gravatar_id":"","url":"https://api.github.com/users/harman83in","html_url":"https://github.com/harman83in","followers_url":"https://api.github.com/users/harman83in/followers","following_url":"https://api.github.com/users/harman83in/following{/other_user}","gists_url":"https://api.github.com/users/harman83in/gists{/gist_id}","starred_url":"https://api.github.com/users/harman83in/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harman83in/subscriptions","organizations_url":"https://api.github.com/users/harman83in/orgs","repos_url":"https://api.github.com/users/harman83in/repos","events_url":"https://api.github.com/users/harman83in/events{/privacy}","received_events_url":"https://api.github.com/users/harman83in/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-27T15:01:03Z","updated_at":"2015-09-27T15:01:03Z","closed_at":null,"body":"Hi guys,\r\n\r\nThis is the first issue I'm submitting, so pardon me if I'm not following all standards.\r\n\r\n## Issue description:\r\nBasically, what I have experienced is that all links within a Pjax block, which require user to login, do not get set in the Yii::$app->getUser()->getReturnUrl(). Hence for all such links the [Controller::goBack()](https://github.com/yiisoft/yii2/blob/master/framework/web/Controller.php#L184) fails and the user after login ends up on the homepage rather than the link clicked\r\n\r\n## How to replicate/debug:\r\nUse a GridView and put a PJAX block around it. Put a link to a page which requires user to login (say www.mydomain.com/user/create). \r\n1. Click on the link in the GridView, you'll be prompted to login, after which you'll go to homepage instead of www.mydomain.com/user/create\r\n2. Logout. Then paste www.mydomain.com/user/create in the browser address bar directly  and after login you will goto www.mydomain.com/user/create as expected.\r\n3. Logout. Comment the PJAX block. Reapeat step 1 and this time you will goto www.mydomain.com/user/create after login.\r\n\r\nI also noticed in case 2 and 3 the Yii::$app->getUser()->getReturnUrl() was getting set correctly, but in case 1 it was being set to '/' instead\r\n\r\n## Causes:\r\nCould it be related to #2692 ?? Haven't dug deeper, but will update this section if I find anything\r\n\r\n## Versions used\r\nIssue replicated on Mac Yosemite using following browsers (Yii version - 2.0.7-dev):\r\nChrome Version 45.0.2454.93 (64-bit)\r\nFirefox 40.0.3"}}