2 Minutes To Code (β Version)

Java Servlets - 2 minute tutorial

How to configure session timeout in deployment descriptor (web.xml)

You can configure the timeout period of an idle session in the deployment descriptor (web.xml) as shown below. The example below configures the timeout as 30 minutes.
<web-app>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
</web-app>