{"id":554,"date":"2010-04-15T17:11:26","date_gmt":"2010-04-15T11:41:26","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=554"},"modified":"2017-03-31T16:28:20","modified_gmt":"2017-03-31T10:58:20","slug":"setting-the-timeout-interval-of-a-httpsession","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/setting-the-timeout-interval-of-a-httpsession\/","title":{"rendered":"Setting the timeout interval of a HttpSession"},"content":{"rendered":"<p>In my project, there was a requirement to set the session time out interval and i had no idea about how to implement it. Then my colleague Himanshu Seth came to rescue. This guy has already done it. All you have to do is to set the maximum time out interval in the session. Here is the sample code.<\/p>\n<p>declare a SESSION_TIMEOUT constant in your application constants file (AppConstants.groovy).<\/p>\n<blockquote>\n<pre lang=\"groovy\">public static final Integer SESSION_TIMEOUT = 3600\t\/\/ This time is set in seconds. 3600 = 1 hour\r\n<\/pre>\n<\/blockquote>\n<p>Now set the maximum inactive interval of session. You need to write this line of code in your controller.<\/p>\n<blockquote>\n<pre lang=\"groovy\">session.setMaxInactiveInterval(AppConstants.SESSION_TIMEOUT);\r\n<\/pre>\n<\/blockquote>\n<p>Hope it helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my project, there was a requirement to set the session time out interval and i had no idea about how to implement it. Then my colleague Himanshu Seth came to rescue. This guy has already done it. All you have to do is to set the maximum time out interval in the session. Here [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":63},"categories":[7],"tags":[4840,208],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/554"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=554"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/554\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}