session
session copied to clipboard
Possible fix for #549
Cookie value decoding should be made in the dedicated decode function provided by npm "cookie".
This may fix issue #549 since a duplicated cookie coming from a domain with a different secret wont be decoded, and so replaced by the one from the good domain.
As a test you can check this behavior with the following code snipet:
cookie.parse('test=bla; test=blou', {decode: _ => _ === 'bla' ? 'bla' : 'blou'});
// { test: 'bla' }
cookie.parse('test=bla; test=blou', {decode: _ => _ === 'bla' ? null : 'blou'});
// { test: 'blou' }