-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cookies are broken with cy.origin #23165
Comments
Hi @denke8. Thank you for opening an issue. Are you able to provide a small reproduction repository that we could run to verify behavior? My guess is the random base url is having an effect here. We typically don't recommend setting the |
Hi @AtofStryker, Thanks for checking on this issue!
Well, since I'm running against a WP installation, I'd need docker to be able to pull up:
Thanks for the tip!
Based on your info above I have altered the test that it no longer sets |
That is completely fine! As long as we have steps to set up the docker orchestration (or a |
Hi @AtofStryker, thanks for the patience! I created the reptoduction repo based on the official reproduction repo: Note, I managed to score a single successful run in Electron, but it too fails 90% of the time. Chrome seems to 100% reproduce the issue, and FireFox (I only dud a couple of runs) also seems to fail Again, thanks for checking on the issue! |
Hey @denke8. Thank you for creating a reproduction! I am trying to give it a run, but am getting the following issues: I am on MacOS. Are you running on native linux? |
Hey @AtofStryker, Yes, I am on ubuntu 22.04, not sure what other steps are required for MacOS (like verify, etc.) Please confirm that you did run Also, you can run that script manually too from the shell like I have also just seen that Cypress 10.5.0 got released, so I'll check that out tomorrow and report back |
I tried it with the latest Cypress version, 10.5.0, (Chrome 104) but unfortunately it did not fix the issue. I updated the repo to reflect this. |
Hey @denke8. I did run the |
@AtofStryker Sounds great, let me know if I can help in any other way .... video, debug output, etc. |
@AtofStryker @rachelruderman Asking because the issue "timeline" states that the "Needs Reproduction" label was removed 5 days ago, but it still shows the flag as active for me. Not sure what's happening. |
Hi @denke8 , thank you for checking in and above all, thank you for your patience!
These are always super helpful. You can find instructions here on how to print your debug logs
This was an oopsie, I just added it back on. I'm working on reproducing your issue, I hope to get back to you tomorrow 🙏 |
Hi @rachelruderman! It seemed like a better approach not to mix in the regular output, so here is the debug log printed to stderr: And the stdout output was the following Please note that there are a total of 3 test (attempts) in the log, in the following order:
Hope this helps
|
Hi @denke8! I used a Linux VM to run your repro and I was able to reproduce the behavior you're seeing 🎉 Thank you for putting together a simple repro for us with clear steps in the README, it helps loads ❤ |
Hi @rachelruderman! I'm glad that it helps, and thank you for checking this issue out! |
@AtofStryker Thanks, appreciate the help! |
Hi @AtofStryker, I have updated the reproduction repo to 12.2. It still does not work, but now WP flat out states that cookies are not supported by the browser |
It looks like I run into similar issue on cypress 12.3 (previously I tried cy.origin on 9.6 and it worked) And my steps are quite basic e.g. same steps works on other domains like aws I find this interesting in replication step: after all I am quite disappointed that feature that worked as experimental doesn't work when released and I cannot even run it on older version as the experimental flag no longer exists |
Hi @AtofStryker, I have updated the reproduction repo to 12.5.1. Would you happen to have any updates for this? |
Hey @denke8. Sorry for the delay here. My linux machine is currently bricked due to some issues with I tried switching from zsh to bash to verify in the terminal and still have the same issue any ideas? |
Hi @AtofStryker, If I remember correctly I encountered the issue too, but the script did run correctly regardless. Please let me know if this is not the case IIRC this error was only shown when the script was executed from under Cypress, but could not figure out the exact reason |
@denke8 I also seem to be running into it just through bash as well. I tried setting |
@AtofStryker https://hub.docker.com/_/wordpress Alternatively, I can create a VM image with a full linux install and docker if you want me to (and upload the disc file somewhere) ... not sure how else to proceed |
@denke8 the VM image might be the way to go since my personal linux machine is currently bricked and not sure what type of permission issues I am going to run into on my mac. I have a VMWare install on my machine and can run an ISO. Just shoot me a link if/when you're able to upload it! |
@AtofStryker I have created an .ova file that you should be able to import. Do you have a way I can privately send you the link? |
can you send it to |
Sent, please look for an email with the title |
I have the exact same issue on a website. When entering the website, it creates a cookie PHPSESSID, which is not preserved while the login form is submitted and therefor the CSRF token fails. |
Hi @AtofStryker |
@denke8 I have the OVA file on hand but haven't had a chance to install the image and investigate. I'm hoping to have time on next rotation to dig in a bit more. |
The issue unfortunately is still present, updated the reproduction to the latest version, 13.2.0 |
I'm hitting this too. Is there a workaround? |
@kgartland-rstudio Not to my knowledge @AtofStryker The reproduction repo has been updated to 13.6.2, the issue seems to persist. |
Having the same problem when testing a login feature with Keycloaks OAuth. Any updates? |
@AtofStryker I have updated the reproduction repo to 13.7.2. Would you happen to have any updates on this issue? |
@denke8 unfortunately no updates on the issue. I appreciate you updating the reproduction though! |
gave this a go with the Cypress 14 Pre release Binary and the issue is still present unfortunately. Note for self: Also, looks like the reason |
@AtofStryker Thank you for taking an other look. Any ideas about the core issue? |
Current behavior
I'm trying to test a WordPress plugin. The plugin does different things depending on if the domain is recognized or not.
For this reason I'm running the exact same test (except the last assertion) twice, once normally, and once wrapped in cy.origin.
experimentalSessionAndOrigin is set to true
The test without the cy.origin works perfectly.
The one wrapped in cy.origin runs twice (test retry):
This is fairly repeatable
Desired behavior
No response
Test code to reproduce
Cypress Version (that I tested with and is broken)
10.3, 10.3.1, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.11, 12.2, 12.5.1, 12.17.0, 13.2.0, 13.6.2, 13.7.2
Other
I suspect that changing Cypress.config('baseUrl'); might be a contributing factor in this issue
Not sure how to create a demo test setup of this complexity (multiple domains, etc.) so please let me know what other information or debug output to provide in order to track down the issue
The text was updated successfully, but these errors were encountered: