Skip to content

Fixed cookie expires calculation - #2377

Merged
tim-schilling merged 4 commits into
django-commons:mainfrom
leduythuccs:patch-1
May 25, 2026
Merged

Fixed cookie expires calculation#2377
tim-schilling merged 4 commits into
django-commons:mainfrom
leduythuccs:patch-1

Conversation

@leduythuccs

Copy link
Copy Markdown
Contributor

Description

expiries.setDate() was returning NaN, causing all cookies to be set without an expiry date and falling back to session-scoped cookies. So all the user settings will get erase when the restart the browser

The first 3 cookies was set before the fix, all have session as expiry
image

Last 2 two is after the fix, which have correct expiry date

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

leduythuccs and others added 2 commits May 22, 2026 14:34
expiries.setDate() was returning NaN, causing all cookies to be set without an expiry date and falling back to session-scoped cookies.
@leduythuccs

Copy link
Copy Markdown
Contributor Author

I don't really have enough context to add test for this specific case 😭

Comment thread docs/changes.rst Outdated
@tim-schilling tim-schilling changed the title fix cookie expiry calculation Fixed cookie expires calculation May 25, 2026

@tim-schilling tim-schilling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, thank you!

@tim-schilling
tim-schilling merged commit fbd8868 into django-commons:main May 25, 2026
28 checks passed
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@leduythuccs
leduythuccs deleted the patch-1 branch May 27, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants