Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Java Servlets<br />
Now try to run the same servlet for second time, it would display following result.<br />
Welcome to my website<br />
Session Infomation<br />
Session info<br />
id<br />
value<br />
0AE3EC93FF44E3C525B4351B77ABB2D5<br />
Creation Time Tue Jun 08 17:26:40 GMT+04:00 2010<br />
Time of Last Access Tue Jun 08 17:26:40 GMT+04:00 2010<br />
User ID<br />
ABCD<br />
Number of visits 0<br />
Deleting Session Data<br />
When you are done with a user's session data, you have several options:<br />
<br />
<br />
<br />
<br />
<br />
Remove a particular attribute: You can call public void removeAttribute(String<br />
name) method to delete the value associated with a particular key.<br />
Delete the whole session: You can call public void invalidate() method to<br />
discard an entire session.<br />
Setting Session timeout: You can call public void setMaxInactiveInterval(int<br />
interval) method to set the timeout for a session individually.<br />
Log the user out: The servers that support <strong>servlets</strong> 2.4, you can call logout to<br />
log the client out of the Web server and invalidate all sessions belonging to all the<br />
users.<br />
web.xml Configuration: If you are using Tomcat, apart from the above<br />
mentioned methods, you can configure session time out in web.xml file as<br />
follows.<br />
<br />
15<br />
<br />
67