You can define the session time out in your applications web.xml in the following tag
</web-app>
The value for the session-timeout tag is in minutes. The above declaration will make your session time-out to
30 minutes.
If you want to maintain the session time-out in the code itself you can do so this way
The value
36000
provided int he above piece of code is in seconds
you can also set the above value to
-1
so that session never expires