Merge branch '2.2.x' into 2.3.x

Closes gh-23750
pull/26228/head
Andy Wilkinson 4 years ago
commit a754b791a2

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,8 +22,6 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ServerProperties;
@ -64,13 +62,6 @@ public class SessionProperties {
this.serverProperties = serverProperties.getIfUnique();
}
@PostConstruct
public void checkSessionTimeout() {
if (this.timeout == null && this.serverProperties != null) {
this.timeout = this.serverProperties.getServlet().getSession().getTimeout();
}
}
public StoreType getStoreType() {
return this.storeType;
}
@ -85,7 +76,8 @@ public class SessionProperties {
* @see Session#getTimeout()
*/
public Duration getTimeout() {
return this.timeout;
return (this.timeout == null && this.serverProperties != null)
? this.serverProperties.getServlet().getSession().getTimeout() : this.timeout;
}
public void setTimeout(Duration timeout) {

Loading…
Cancel
Save