Skip to content
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

Cypress sets explicit domain cookies during cy.visit incorrectly #207

Closed
brian-mann opened this issue Sep 4, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@brian-mann
Copy link
Member

brian-mann commented Sep 4, 2016

Taken from here: bahmutov/express-sessions-tutorial#4

During a cy.visit or cy.request Cypress internally sets cookie values directly on the browser using the appropriate automation API's.

However there is an edge case where when Cypress receives a non domain based cookie it will incorrectly set the domain property on the cookie causing the cookie to be set as an explicit domain based cookie.

This has the effect of "doubling" cookies in the browser when the origin under test is not localhost.

These cookies are called hostOnly cookies, and the domain property should be omitted when setting cookies.

You can see this happening here:

describe("Domain Cookies", function(){
  Cypress.Cookies.debug(true)

  it("doubles the cookies", function(){
    cy.visit("http://66f9dab4.ngrok.io").getCookies()
  })
})

screen shot 2016-09-04 at 1 10 46 pm

screen shot 2016-09-04 at 1 10 58 pm

@brian-mann brian-mann added this to the 0.17.2 milestone Sep 4, 2016
@brian-mann brian-mann self-assigned this Sep 6, 2016
@brian-mann
Copy link
Member Author

Fixed in 0.17.2.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant