session icon indicating copy to clipboard operation
session copied to clipboard

Possible fix for #549

Open Poyoman39 opened this issue 6 years ago • 0 comments

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' }

Poyoman39 avatar Jun 13 '19 12:06 Poyoman39