-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix to save session when overwrite configuration is set #30
Conversation
Please look into/fix why the tests are failing with this change. |
Thanks for sorting that at Purple Panda. Doug, anything else I can do on this one? Also, do you have a tentative date for future release? |
Sorry, GitHub does not notify me when new commits are pushed on PRs, so I didn't even know it was fixed yet :) Looks like a default value was changed in the README and a test was deleted. These signal to me this is not a backwards-compatible change and would require a major version bump. If this is the case, I cannot promise any timeline. Is this really a breaking change? |
That's alright @dougwilson. I'm sure its not easy maintaining so many repositories. As for the documentation, it was actually just wrong before. It looks like it was just copy/pasted from the documentation at https://github.com/pillarjs/cookies, but the code clearly sets the As for the test, I didn't actually delete the test I just moved it around it a bit. I added a sub-describe under I guess if users of the module are not expecting the cookie to be updated without a change to the cookie of the contents changing this could be considered a breaking change. Sorry for the novel. |
Ah, thank you so much for the explanation :) Sometimes modules like this where I inherited them rather than wrote them, it is hard to me to tell right away. With that explanation, I'll try to look at it this weekend, and if it looks good, I'll make a release. |
+1 Anything needed to get this one released? Happy to help out if needed, would love to have this work as described above! |
Hi! I just took a look into this and this change is not valid; The documentation fix, though, is valid and accepted in 81fd013 |
@dougwilson, after further review I agree that If this is an acceptable solution. I will gladly submit a pull requests to implement it. |
Sounds fine; we can always discuss the option's name in said PR, I wouldn't worry about it here :) I tried to implement it myself when I made my last comment and found it almost impossible to use, since if the browser makes two parallel requests, and you alter the session in one request, which comes back first, the second request coming back clobbers the changes. |
Closing this PR, since the change was found to be invalid, since it was just a misunderstanding of the existing behavior. I was hoping there would be a follow-up PR, but nothing has appear so far :( |
In the current version, if you update maxAge or expires without changing the content of the session, the session cookie does not get resaved with the new expiration. This fixes that by saving the session when the existing overwrite property is set to true.