iron-session
iron-session copied to clipboard
Cypress tests failing: Cypress sanitizes cookies and breaks tests.
The seals generated by this library frequently end with ~2
. So when you add a cookie with ~2
in Cypress via cy.setCookie
it sanitizes it to \\x7e
, which then is not recognized by iron-session
's unseal.
It is because of the version delimiter.
const currentMajorVersion = 2;
const versionDelimiter = "~";
Let me know and I can make a PR for this to fix it in this library 🙏
Hey @janhesters, were you able to figure out a solution? I'm currently on cypress version 9.6.1
@janhesters If you manage to create a new version delimiter while maintaining compatibility with previous versions and while making sure the character is compatible with URLs too (tokens should be able to be used in URLs) then I am all in for a PR 👍