I've been attempting to decode a cookie without much luck. The cookie looks like this:
s%3Ak0tBm_lnBeH4G5pPIbbFKktQl0l4pNU8.d2ZbSvwFjkmVWfcS9Wn0%2Fi2oSnTYI09krfOOWJAXirE
.
This particular cookie was generated using the express-session module.
My unsuccessful attempt at decoding the cookie involved the following code snippet:
const cookieParser = require("cookie-parser");
console.log(cookieParser.signedCookie("s%3Ak0tBm_lnBeH4G5pPIbbFKktQl0l4pNU8.d2ZbSvwFjkmVWfcS9Wn0%2Fi2oSnTYI09krfOOWJAXirE", "jksadhjk123io12ejnmlad'132hv8891"));
Instead of the expected decoded data, I only received the first parameter of signedCookie ("s%3Ak0tBm_..."). What I'm hoping for is something along the lines of:
{
{ path: '/',
_expires: 2019-09-08T22:33:17.317Z,
originalMaxAge: 3600000,
httpOnly: true,
secure: false,
domain: null,
sameSite: true
},
userID: 5d6ffe165d6eb10a7905c633
}