raj
raj

Reputation: 3811

One second session time out in spring boot

I configured the application.properties to have a one second session time out. (I was just doing this to test session time out in my application. The real application will have a much longer session)

server.session.timeout=1
server.session.tracking-modes=cookie

In the browser, i refreshed the page every 5 seconds to see if JSESSIONID is changing. But looks like it isn't.

enter image description here

Although, I tried refreshing after a while, the JSESSIONID changed.

Is there a minimum session time out in spring boot?

Upvotes: 1

Views: 1831

Answers (1)

shankarsh15
shankarsh15

Reputation: 1967

server.session.timeout works only in case of embedded tomcat container and not in case of Standalone.

If you want to set it , you have to configure it in web.xml

something like below:

<session-config>
    <session-timeout>1</session-timeout>
</session-config>

so in this case, session timeout will be set to 1 min

Upvotes: 1

Related Questions