<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=Session_Timeout</id>
		<title>Session Timeout - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=Session_Timeout"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Timeout&amp;action=history"/>
		<updated>2026-05-02T23:28:54Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=235306&amp;oldid=prev</id>
		<title>Imifos: Moved page into the right category. See Java space page for me details. Content has not been reviewed in this edit.</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=235306&amp;oldid=prev"/>
				<updated>2017-11-10T21:53:31Z</updated>
		
		<summary type="html">&lt;p&gt;Moved page into the right category. See Java space page for me details. Content has not been reviewed in this edit.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:53, 10 November 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot; &gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OWASP &lt;/del&gt;Java &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Project&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Java]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Imifos</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=157052&amp;oldid=prev</id>
		<title>Owen Pendlebury: fixed spelling mistake &quot;&quot;stole&quot;&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=157052&amp;oldid=prev"/>
				<updated>2013-08-20T15:29:56Z</updated>
		
		<summary type="html">&lt;p&gt;fixed spelling mistake &amp;quot;&amp;quot;stole&amp;quot;&amp;quot;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:29, 20 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l83&quot; &gt;Line 83:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 83:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Impact of the session timeout on security and best practices==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Impact of the session timeout on security and best practices==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Session timeout define action window time for a user thus this window represents, in the same time, the delay in which an attacker can try to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;stole &lt;/del&gt;and use a existing user session...&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Session timeout define action window time for a user thus this window represents, in the same time, the delay in which an attacker can try to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;steal &lt;/ins&gt;and use a existing user session...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this, it's best practices to :&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this, it's best practices to :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Owen Pendlebury</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=138957&amp;oldid=prev</id>
		<title>Mark Law at 23:58, 6 November 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=138957&amp;oldid=prev"/>
				<updated>2012-11-06T23:58:01Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:58, 6 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l88&quot; &gt;Line 88:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 88:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Set session timeout to the minimal value possible depending on the context of the application.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Set session timeout to the minimal value possible depending on the context of the application.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Avoid &amp;quot;infinite&amp;quot; session timeout.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Avoid &amp;quot;infinite&amp;quot; session timeout.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Prefer declarative definition of the session timeout in order to apply global timeout for all &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;applicatin session&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Prefer declarative definition of the session timeout in order to apply global timeout for all &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;application sessions&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:OWASP Java Project]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:OWASP Java Project]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mark Law</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=123020&amp;oldid=prev</id>
		<title>Dominique RIGHETTO: Page creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Timeout&amp;diff=123020&amp;oldid=prev"/>
				<updated>2012-01-22T17:12:38Z</updated>
		
		<summary type="html">&lt;p&gt;Page creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Status==&lt;br /&gt;
Released on (mm/dd/yyyy) : 01/22/2012&lt;br /&gt;
&lt;br /&gt;
==Description of the session timeout==&lt;br /&gt;
Session timeout represents the event occuring when a user do not perform any action on a web site during a interval (defined by web server). The event, on server side, change the status of the user session to 'invalid' (ie. &amp;quot;not used anymore&amp;quot;) and instruct the web server to destroy it (deleting all data contained into it).&lt;br /&gt;
&lt;br /&gt;
==Define the session timeout==&lt;br /&gt;
On JEE web application , there 2 ways to define session timeout,&lt;br /&gt;
* Declaratively in web deployment descriptor (file &amp;quot;web.xml&amp;quot;) : This definition is applied to all session created for the application.&lt;br /&gt;
* Programmatically on session object : This definition apply only on current session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Timeout defined declaratively'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;web-app xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;br /&gt;
	xmlns=&amp;quot;http://java.sun.com/xml/ns/javaee&amp;quot; xmlns:web=&amp;quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&amp;quot;&lt;br /&gt;
	xsi:schemaLocation=&amp;quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&amp;quot;&lt;br /&gt;
	id=&amp;quot;WebApp_ID&amp;quot; version=&amp;quot;3.0&amp;quot;&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	...&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;!-- Define a session timeout to 15 minutes --&amp;gt;&lt;br /&gt;
	&amp;lt;session-config&amp;gt;&lt;br /&gt;
		&amp;lt;session-timeout&amp;gt;15&amp;lt;/session-timeout&amp;gt;&lt;br /&gt;
	&amp;lt;/session-config&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	...	&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/web-app&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Timeout defined Programmatically'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package org.owasp.javaproject.sessiontimeout;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.ServletException;&lt;br /&gt;
import javax.servlet.annotation.WebServlet;&lt;br /&gt;
import javax.servlet.http.HttpServlet;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
import javax.servlet.http.HttpSession;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Code sample showing how to access to session timeout and act on it.&lt;br /&gt;
 */&lt;br /&gt;
@SuppressWarnings(&amp;quot;serial&amp;quot;)&lt;br /&gt;
@WebServlet(&amp;quot;/SessionTimeout&amp;quot;)&lt;br /&gt;
public class SessionTimeoutCodeSample extends HttpServlet {&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * {@inheritDoc}&lt;br /&gt;
	 * &lt;br /&gt;
	 * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,&lt;br /&gt;
	 *      javax.servlet.http.HttpServletResponse)&lt;br /&gt;
	 */&lt;br /&gt;
	@SuppressWarnings(&amp;quot;boxing&amp;quot;)&lt;br /&gt;
	@Override&lt;br /&gt;
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {&lt;br /&gt;
		// Get reference on session object&lt;br /&gt;
		HttpSession session = req.getSession();&lt;br /&gt;
&lt;br /&gt;
		// Display session timeout value defined in &amp;quot;web.xml&amp;quot;&lt;br /&gt;
		// Value here is specified in seconds...&lt;br /&gt;
		System.out.printf(&amp;quot;Session timeout defined at application level : %s\n&amp;quot;, session.getMaxInactiveInterval());&lt;br /&gt;
&lt;br /&gt;
		// Change session timeout for this session and display new timeout value&lt;br /&gt;
		// Value here is defined in seconds...&lt;br /&gt;
		session.setMaxInactiveInterval(60);&lt;br /&gt;
		System.out.printf(&amp;quot;Session timeout defined at code level : %s\n&amp;quot;, session.getMaxInactiveInterval());&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Session timeout defined at application level : 900&lt;br /&gt;
Session timeout defined at code level        : 60&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Impact of the session timeout on security and best practices==&lt;br /&gt;
Session timeout define action window time for a user thus this window represents, in the same time, the delay in which an attacker can try to stole and use a existing user session...&lt;br /&gt;
 &lt;br /&gt;
For this, it's best practices to :&lt;br /&gt;
* Set session timeout to the minimal value possible depending on the context of the application.&lt;br /&gt;
* Avoid &amp;quot;infinite&amp;quot; session timeout.&lt;br /&gt;
* Prefer declarative definition of the session timeout in order to apply global timeout for all applicatin session.&lt;br /&gt;
* Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Java Project]]&lt;/div&gt;</summary>
		<author><name>Dominique RIGHETTO</name></author>	</entry>

	</feed>