Fix bug: cookie.expires not modified even if maxAge set - #277
Closed
jjqq2013 wants to merge 5 commits into
Closed
Conversation
Contributor
|
Hi! Please update your change to use an if statement. Also, please add a test to our test suite that fails without your fix and passes with your fix. |
Author
|
Hi i have added test case for this problem. My test case: My test result: After modification: I don't dig too deep for the problem, so maybe my modification is not the best method. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: #276.
Hi, i found when access server at second time, cookie.expire will not be modified even if i set maxAge and rolling:true.
Here is my test code.
In above example, i set maxAge to 10 seconds, and rolling:true, and saveUninitialized:true. Other settings seems have no effect to this problem.
I run this code, then use following curl command line to test and see verbose output:
After about 5 seconds, i run the command line again, it will use same cookie from last response.
Please notice the expire of second response, i'v set maxAge to 10 seconds, but cookie's expire will be:
It means expire after 4 seconds, this is not by-design obviously.
I checked source code in index.js, line 206:
*I insert following code to line 206 to change cookie.expire* then works!
I hope you can check this and merge it.