Open
Description
Due to privacy/security concerns, we have to encrypt the sessionID that's stored within a cookie. It would be great, if we could set a cookie value/sessionID serializer within the session options so we can keep using your excellent module. I am aware of the reasons for 'signing' a cookie values and being able to 'encrypt' the sessionID should not replace 'signing' the cookie. It should be in addition to 'signing' the cookie value.
If I would supply you with a pullrequest (from a fork) that implements the following change, the option to supply your own sessionID/value serializer using options.serializer; would you be willing to consider it?
function session(options) {
var opts = options || {};
// get/set the cookie value serializer
var serializer = opts.serializer || { parse: value => value, stringify: value => value };
...
}
// set cookie
setcookie(res, name, serializer.stringify(req.sessionID), secrets[0], req.session.cookie.data);
function getcookie(req, name, secrets) {
...
return serializer.parse(val);
}