Raimar Falke
Raimar Falke

Reputation: 13

Specify time to live for a tomcat session?

There is the session timeout setting:

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

which control how long an inactive session stays valid.

Is it possible in addition to specify how long a session can live at all? To specify a "time to live" or a "max age" after which the user is forced to login again?

It is possible to do this with a tomcat configuration?

Upvotes: 1

Views: 1046

Answers (1)

barbiepylon
barbiepylon

Reputation: 911

Add this (inside session-config):

<cookie-config>
    <max-age>VALUE</max-age>
</cookie-config>

Upvotes: 1

Related Questions