我从git下载了JHipster,并试图了解如何配置会话超时但却找不到任何web.xml
或基于java的类。
你能帮我弄清楚如何配置session
超时,例如20分钟?
这是一个Spring Boot配置。
您可以在application-*.yml
文件中配置它:
server:
port: 8080
address: localhost
sessionTimeout: 20000
在您的应用程序中 - *。yml文件:
server:
port: 8080
address: localhost
sessionTimeout: 20000
可以持续20分钟,但是如果你想要有更长的30分钟,你的访问令牌有效期(“tokenValidityInSeconds”属性)默认为30分钟。您可以在application.yml文件中配置此属性。
3小时= 180分钟= 10800秒的示例:
authentication:
oauth:
clientid: testspsyapp
secret: mySecretOAuthSecret
# Token is valid 3 hours
tokenValidityInSeconds: 10800
不要忘记更改“session Timeout”属性到您的应用程序 - *。yml文件:)
server:
port: 8080
address: localhost
sessionTimeout: 180000