New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setCookie script does not work with https #844
Comments
@a701440 Can you post an example script? Also what location and device are you selecting? |
I have reported this too (see https://www.webpagetest.org/forums/showthread.php?tid=14844) but unfortunately I can't share my script due to sensitive data. My input here is (a) i noticed it after updating to agent version 371 and (b) it also happens on our local instance so not location/device specific ... |
Hi, I just discovered that the problem is happening only in Firefox. Here are two exact tests with scripting, setting a cookie to remove the cookie bar (on the top of the screenshot):
You can see the setCookie worked on Chrome but not on Firefox. I see something different, though, if I use the API (npm), but it also fails. I think this functionality needs to be reviewed with the update. Thanks |
I hit this too, and here's what I've found: 1.Without entering a website URL at the top "Enter a Website URL," but instead, you paste the following into the "Script" tab on https://www.webpagetest.org/ (or your instance), the cookie won't get set in Firefox[0]:
2.If, instead (still specifying Firefox), you type in https://addons-dev.allizom.org into the "Enter a Website URL" textfield, and then use the "Advanced" tab and under "Custom Headers" to insert the following:
It works[1] 3.Specifying Chrome, without entering the URL into "Enter a Website URL," but just entering the same script from 1:
It works[2] [0] https://www.webpagetest.org/result/170809_43_1Z6V/ |
@pmeenan @digitarald are you able to confirm, help diagnose why? Thanks! |
Setting a cookie goes down a different code path than adding headers. Adding headers is supported by the webRequest extension support. I'm not sure if the ability to set cookies was wired up in the move to the new extension. At a minimum I can alias the setCookie command to add the cookie header instead in the Firefox case but that may break cases where other cookies are set during the session. |
FWIW, looks like it need to be hooked up to this. |
Thanks, @pmeenan - In case it helps others, a workaround for Firefox is to do something like: stephendonner/webpagetest-amo@73f6e66 which uses addHeader (you can also use setHeader) to set a cookie with the appropriate value(s). |
On our private instance we have the same issue on chrome. The cookie is not added. The same issue persists with using the AddHeader function. https://www.webpagetest.org/results.php?test=171124_4F_3c505e68a9a6d86d4d0428c6131be148 |
@stephendonner Is there any idea how to resolve it / a fix that is coming? |
@kazazor I have the same problem,and I don't known how to fix it. |
We're in the process of cleaning up issues on this project in order to ensure we're able to stay on top of high priority bugs and feature requests. As a part of this process, we're automatically closing any issues that have had no activity within the last two years, including this one, since the codebase has changed dramatically in that time. If you feel this is still relevant, please file a new issue using the relevant issue template so we can get it prioritized. Thanks! |
With Chrome use a script to set cookie on a https url and then navigate to the https url. The request headers do not contain the requested cookie. When using http urls it does work.
The text was updated successfully, but these errors were encountered: