cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.02k stars 3.18k forks source link

__cypress.initial cookie expired date causing signin side-effects #29268

Closed jj497 closed 6 months ago

jj497 commented 7 months ago

Current behavior

Testing Login on a 3rd party website. __cypress.initial cookie is set with domain of the 3rd party (target) website that expires 1970-01-01T00:00:00.000Z. This cookie is visible under the cookie tab of the login request. As a result, subsequent calls to complete the login fail because of an expired token.

Since I don't own the login page, I can't update the logic. However, I know this is the issue because I've retested changing the first visit url to another website in order to change the domain of the __cypress.initial cookie. Login is successful, but the dashboard page takes forever to load.

Desired behavior

set __cypress.initial cookie with an expire property in the future like 2070-01-01T00:00:00.000Z

Test code to reproduce

N/A

Cypress Version

13.7.1

Node version

v21.2.0

Operating System

macOS 12.7.3

Debug Logs

N/A

Other

No response

cacieprins commented 7 months ago

Hi @jj497 ,

The __cypress.initial cookie is used internally by Cypress, and should not impact your application tokens. You should not have to access this cookie yourself. Can you provide us with a sample reproduction on a fork of cypress-test-tiny or cypress-realworld-app?

Thank you!

jennifer-shehane commented 6 months ago

We’ll close this issue since a repro has not been provided.