-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Broken method setCookie or document.cookie #5198
Comments
I'll just +1 that setting cookies seems to have changed (broken) without us changing any code or Cypress versions. In my case the error is 'TypeError: Cannot read property 'replace' of undefined [even though we are successfully getting a token that should be set as a cookie. Programmatic login DOES seem to work on Electron, but is broken in Chrome, and happens across our local systems but not on our CI (which is Chrome-pinned). So it feels like something changed in how Chrome assigns cookies? Edit: The above report looks like it's older Chrome, so maybe this isn't the issue, but I still think it's likely...the latest Chrome release seems to have done a bunch of work to how cookies are handled. Anyone else have the issue? More information for the team to use to reconcile? |
Related: #5142 (changes between chrome 76 => 77) |
Thanks for the link, flotwig. I'll dig into that ticket and see if it resolves our issues. EDIT: For anyone else just now seeing this issue...the above link on cookie domain formatting got us up and running again. |
Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen. |
Current behavior:
Can't set a cookie for a browser to recognize as the login user. The cookie should be a string with the format:
a41c0f40492c7a0ce155e4fde1d800a9; Path=/XXX-crm-api; HttpOnly
I tried both methods - setCookie and document.cookie. I do not see the cookie in browser memory if I set specified path other than "/'. If the path is not specified the cookie does not work properly.
Here I left the path empty, but as you can see Cypress ads "." before the domain.
Desired behavior:
Cookie is set properly and app redirects to the main site as a logged user. Test passes.
Steps to reproduce: (app code and test code)
login_using_cookie.js:
commands.js:
Versions
Cypress v3.4.1
Chrome v76
Electron v61
The text was updated successfully, but these errors were encountered: