Cypress · Middle · Question 52 of 77

How do you get a cookie value to assert on it?

Show the answer

Correct answer: cy.getCookie('session').should('exist')

Explanation

cy.getCookie yields an object with value, httpOnly, secure and more, so security flags can be checked.

Further reading

Problem with a question

Cypress · Middle · question 52

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz