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

Give theme cookie an expiration #5429

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Give theme cookie an expiration #5429

merged 4 commits into from
Aug 26, 2024

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Aug 26, 2024

Description

I noticed that Aspire dashboard sometimes lost the theme. The reason is the theme cookie had a session lifetime. Once all browsers are closed the cookie is cleared and the dashboard forgets the configured theme.

This PR:

  • Gives the cookie a 1 year expiration
  • If the theme cookie is present when the dashboard loads, it is set again to create a sliding expiration (i.e. cookie expires 1 year after the dashboard was last loaded)
  • Specifies a path when working with the cookie to be explicit about where it is set
  • Deletes the cookie if "System" is selected in the UI. No point having a cookie set and updating it if it is the default value.

image

Fixes #5430

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

@JamesNK JamesNK merged commit e0042ce into main Aug 26, 2024
11 checks passed
@JamesNK JamesNK deleted the jamesnk/theme-cookie branch August 26, 2024 23:55
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist dashboard theme
2 participants