X Tutup
The Wayback Machine - https://web.archive.org/web/20201218223031/https://github.com/expressjs/session/pull/667
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix for #549 #667

Open
wants to merge 2 commits into
base: master
from
Open

Possible fix for #549 #667

wants to merge 2 commits into from

Conversation

@Poyoman39
Copy link

@Poyoman39 Poyoman39 commented Jun 13, 2019

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' }
Johan Maupetit added 2 commits Jun 13, 2019
Johan Maupetit
Johan Maupetit
@Poyoman39 Poyoman39 changed the title Possible fix for https://github.com/expressjs/session/issues/549 Possible fix for #549 Jun 13, 2019
@dougwilson dougwilson added the pr label Oct 8, 2019
Copy link
Member

@dougwilson dougwilson left a comment

Hi and thank you for your pull request!

I'm not very clear on what this change is doing; perhaps you can add a test to the PR to test the change or explain in more detail so I can help make a test to add to our test suite?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.
X Tutup