Skip to content

Commit a0afb73

Browse files
committed
Merge branch '2.3.x'
Closes gh-23751
2 parents 4a38401 + a754b79 commit a0afb73

File tree

1 file changed

+3
-11
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session

1 file changed

+3
-11
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,6 @@
2222
import java.util.HashSet;
2323
import java.util.Set;
2424

25-
import javax.annotation.PostConstruct;
26-
2725
import org.springframework.beans.factory.ObjectProvider;
2826
import org.springframework.beans.factory.annotation.Autowired;
2927
import org.springframework.boot.autoconfigure.web.ServerProperties;
@@ -64,13 +62,6 @@ void setServerProperties(ObjectProvider<ServerProperties> serverProperties) {
6462
this.serverProperties = serverProperties.getIfUnique();
6563
}
6664

67-
@PostConstruct
68-
public void checkSessionTimeout() {
69-
if (this.timeout == null && this.serverProperties != null) {
70-
this.timeout = this.serverProperties.getServlet().getSession().getTimeout();
71-
}
72-
}
73-
7465
public StoreType getStoreType() {
7566
return this.storeType;
7667
}
@@ -85,7 +76,8 @@ public void setStoreType(StoreType storeType) {
8576
* @see Session#getTimeout()
8677
*/
8778
public Duration getTimeout() {
88-
return this.timeout;
79+
return (this.timeout == null && this.serverProperties != null)
80+
? this.serverProperties.getServlet().getSession().getTimeout() : this.timeout;
8981
}
9082

9183
public void setTimeout(Duration timeout) {

0 commit comments

Comments
 (0)