fetch drops session data #15759
Unanswered
jdfadams-msp
asked this question in
Docker
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an integration test that logs in to my web app, visits a search page, and tries to search.
Test fragment:
Javascript:
ajax/search.php authenticates the session before searching.
When I run this test in the cypress desktop app, the request arrives at ajax/search.php with session data, and the test passes.
When I run this test in a cypress docker container, the request arrives at ajax/search.php without session data, and the test fails.
When I run this test in a cypress docker container but add
credentials: 'include'
to thefetch
options, the request arrives at ajax/search.php with session data, and the test passes.When I run this test in a cypress docker container but replace
fetch
with equivalent jQuery,the request arrives at ajax/search.php with session data, and the test passes.
Why does the POST via
fetch
drop session data when the test runs in a cypress docker container? Does cypress hook intofetch
in such a way that the request appears to be to a different domain?Beta Was this translation helpful? Give feedback.
All reactions