Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.2.2
* oauth2-oidc-remember-me
* Handle cookie path correctly

# 2.2.1
* Use `ConcurrentReferenceHashMap` in favor of `Collections.synchronizedMap(new WeakHashMap<>())` to improve performance

Expand Down
2 changes: 1 addition & 1 deletion demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Dependency Version Groups -->
<com.vaadin.version>25.1.1</com.vaadin.version>
<com.vaadin.version>25.1.2</com.vaadin.version>

<org.springframework.boot.version>4.0.5</org.springframework.boot.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ protected Cookie buildCookie(final String name, final String value)
cookie.setHttpOnly(true);
cookie.setSecure(this.cookieSecureService.isSecure());
cookie.setMaxAge((int)this.config.getExpiration().toSeconds());
cookie.setPath("/");
cookie.setPath(this.config.getCookiePath());
return cookie;
}

Expand Down Expand Up @@ -691,6 +691,9 @@ protected void deleteCookie(final Cookie cookie, final HttpServletResponse respo
{
// Expire cookie
cookie.setMaxAge(0);
// Set path correctly or browser will ignore it
cookie.setPath(this.config.getCookiePath());

response.addCookie(cookie);

LOG.debug("Expiring Cookie[name='{}']", cookie.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class OAuth2CookieRememberMeServicesConfig
private String payloadCookieName = "AC"; // Auth Cache
@NotEmpty
private String idCookieName = "ACID"; // Auth Cache Identifier
@NotEmpty
private String cookiePath = "/";

@NotNull
private Duration expiration = Duration.ofDays(3);
Expand Down Expand Up @@ -76,6 +78,16 @@ public void setIdCookieName(final String idCookieName)
this.idCookieName = idCookieName;
}

public String getCookiePath()
{
return this.cookiePath;
}

public void setCookiePath(final String cookiePath)
{
this.cookiePath = cookiePath;
}

public Duration getExpiration()
{
return this.expiration;
Expand All @@ -98,7 +110,7 @@ public void setMaxPerUser(final int maxPerUser)

public OAuth2CookieRememberMeServicesCleanupScheduleConfig getCleanupSchedule()
{
return cleanupSchedule;
return this.cleanupSchedule;
}

public void setCleanupSchedule(final OAuth2CookieRememberMeServicesCleanupScheduleConfig cleanupSchedule)
Expand All @@ -116,6 +128,8 @@ public String toString()
+ this.payloadCookieName
+ "', idCookieName='"
+ this.idCookieName
+ "', cookiePath='"
+ this.cookiePath
+ "', expiration="
+ this.expiration
+ ", maxPerUser="
Expand Down
2 changes: 1 addition & 1 deletion vaadin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>25.1.1</version>
<version>25.1.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down