使用版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
在配置文件中加入
#设置会话超时
server.servlet.session.cookie.max-age=300s
单位s代表秒。