Session timeout in Spring Security Java configuration
<p>I put session time out in deployment descriptor file but it is not working and I am using Spring Security. Is anything need to configure in Spring Security.</p>

<p>This is the configuration in Spring Security:</p>

<pre class="lang-java prettyprint-override"><code>http.sessionManagement()
    .invalidSessionUrl("/login?invalid=1")
    .maximumSessions(1)
        .expiredUrl("/login?time=1")
        .maxSessionsPreventsLogin(true);
</code></pre>

<p>This is in deployment descriptor:</p>

<pre class="lang-xml prettyprint-override"><code>&lt;session-config&gt;
    &lt;session-timeout&gt;1&lt;/session-timeout&gt;
&lt;/session-config&gt;
</code></pre>