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

adds session-cookie boolean configuration #1906

Open
wants to merge 8 commits into
base: 4.12.x
Choose a base branch
from

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Jan 7, 2025

https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies

Session cookies — cookies without a Max-Age or Expires attribute – are deleted when the current session ends. The browser defines when the "current session" ends, and some browsers use session restoring when restarting. This can cause session cookies to last indefinitely

Currently, we set an expiration date for the cookie if no expiration date was defined in the configuration. We set the cookie containing the JWT as the value, with an expiration date matching the JWT exp claim.

Thus, users can't leave the expiration date empty and, therefore, configure a token cookie as a session cookie. Some users asked for this.

This PR adds a configuration option to define whether a cookie is a session cookie. When set to true, then no Expires attribute is set for the cookie, making it a session cookie.

Close: #339

By default, there was already an expiration date. This PR adds a configuration option to define. whether the cookie is a [session cookie](https://en.wikipedia.org/wiki/HTTP_cookie#Expires_and_Max-Age). A session cookie does not have an expiration date.

When set to true, then no Expires atttribute is set for the cookie, making it an session cookie.

Close: #339
@sdelamo sdelamo added the type: improvement A minor improvement to an existing feature label Jan 7, 2025
sdelamo and others added 5 commits January 8, 2025 07:06
….1 (#1905)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This pull request extracts two methods to ease TokenCookieLoginHandler bean replacement.

see: #339
Copy link

sonarqubecloud bot commented Jan 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
68.8% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

micronaut cookie max-age session value
3 participants