Dani
02/18/2023, 8:24 PMSnackdex
02/18/2023, 8:51 PMDani
02/18/2023, 8:58 PMrequest.cookie
and if defined, it just gets the cookie from there, assuming that the cookie header was correctly parsed already.
I had this code in my express app:
req.cookies = req.cookies || {};
req.headers.cookie?.split(";").forEach((cookie) => {
const [key, value] = cookie.split("=");
req.cookies[key.trim()] = value;
});
This code doesn't url-decode the strings, so that was the issue. After removing this code, Supertokens looks at the request.headers and parses the cookie correctly itself.