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

Closed
wants to merge 2 commits into from
Closed

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

@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
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@Poyoman39 Poyoman39 closed this by deleting the head repository May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants