Ajax location.replace receives its own HTML code as data
Reported by
vertigos...@gmail.com,
Mar 21 2018
|
|||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
Steps to reproduce the problem:
1. Create a simple HTML page with a button that triggers an Ajax call to verify if the user is already logged in.
2. Create the PHP so as to check if the call is a POST and if ($_SESSION["FOO"]) is set.
3. Upon both true, the user is sent to their user page.
Upon both false, the user is sent back to original page.
If either one is false, reload the original page.
What is the expected behavior?
if ($_SERVER["REQUEST_METHOD"] == "POST" && !isset ($_SESSION["FOO"])) the original page should reload without problems.
What went wrong?
When POST is true && FOO is false the page reloads but, and here's the rub, the Ajax will receive, as its data, the whole of the HTML original page.
ie: success: function (data) { location.replace(data); }
Did this work before? N/A
Chrome version: 65.0.3325.162 Channel: n/a
OS Version: 10.0
Flash Version:
I'm not an expert on headers and php. But it seems illogical that when the same page is reloaded, the HTML code is receive by the Ajax request. You may verify that with a simple console.log(data);
Thank you for your time
-Francois Dion
,
Mar 21 2018
,
Mar 22 2018
vertigostardust@ - Thanks for filing the issue...!! Could you please provide a sample test file/url to test the issue from TE-end. This will help us in triaging the issue further. Thanks...!!
,
Mar 22 2018
This project is testing phase, so obviously there's no url. As far as the sample file is concerned, I'm unsure what you need more other than the one I've already included in the original report ( https://bugs.chromium.org/p/chromium/issues/attachmentText?aid=330473 )
,
Mar 22 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 3 2018
can you provide a standalone working repro case, or netlog, https://www.chromium.org/for-testers/providing-network-details? sounds like a wrong server side code.
,
Apr 3 2018
With all due respect, help the parent company of the April 2nd 2018 YouTube 500 internal error purple monkey fiasco? I trow not! I wasted more than three hours to understand the problem lays in your browser when the same page is reloaded yet answers the old page's Ajax call. In humble conclusion, a fable paraphrased: "to each his job and the PHP shall be well coded" NB: many injectives, for certain injurious, have been refrained by the loving care of my dear patient wife to whom belongs the... <i>"faulty server"</i>
,
Apr 3 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 3 2018
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by susan.boorgula@chromium.org
, Mar 21 2018