简体   繁体   中英

Spring and session timeout on JBoss

I want to setup session timeout to 15 minutes. I set server.session.timeout to 900 and it works when I run the app in the provided Tomcat. However, when I deploy the application on the JBoss session timeout doesn't occur after 15 minutes. How can I achieve this?

In spring boot server.session.timeout is in minutes not seconds.

In your web.xml , number is in minutes.

<web-app ...>
    <session-config>
        <session-timeout>20</session-timeout>
    </session-config>
</web-app>

If you are using Spring Boot, you can add the below property to your WEB-INF/application.properties (if you don't have one, create it under WEB-INF folder):

server.session.timeout=900

For more details on application.properties , you can refer the below link:

http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM