<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to extend a user session time programmatically?</title><link>https://answers.axonivy.com/questions/2556/how-to-extend-a-user-session-time-programmatically</link><description>&lt;p&gt;Dear Ivy support,&lt;/p&gt;
&lt;p&gt;Using Ivy 6.2 we set the User session time-out value in the web.xml. 
Is there a way to extend the session validity programmatically without any User action? &lt;/p&gt;
&lt;p&gt;In a JSF context, would this method have any effect on the Ivy Session ?
javax.faces.context.ExternalContext.setSessionMaxInactiveInterval(int interval) 
&lt;em&gt;Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance
Emmanuel&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2556/how-to-extend-a-user-session-time-programmatically" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 03 Apr 2017 16:05:05 -0400</lastBuildDate><item><title>Answer by Alex Suter</title><link>https://answers.axonivy.com/questions/2556/how-to-extend-a-user-session-time-programmatically/2562</link><description>&lt;p&gt;Hi &lt;a href="http://answers.axonivy.com/users/28/emmanuel"&gt;&lt;a href="http://answers.axonivy.com/users/28/emmanuel"&gt;@Emmanuel&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ivy sessions are mapped to the http sessions. If the webserver (tomcat) destroys a http session, the ivy session will be also destroyed.&lt;/p&gt;
&lt;p&gt;The only way to modify programmitcly the session timeout seems to be the following way:
&lt;a href="http://stackoverflow.com/questions/2960764/how-to-set-session-timeout-dynamically-in-java-web-applications"&gt;http://stackoverflow.com/questions/2960764/how-to-set-session-timeout-dynamically-in-java-web-applications&lt;/a&gt;
Create your own &lt;code&gt;HttpSessionListener&lt;/code&gt; and register this one in the web.xml. But this is probably not what you want.&lt;/p&gt;
&lt;p&gt;In a JSF environment you should have another opportunity, as you mentioned:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;javax.faces.context.ExternalContext.setSessionMaxInactiveInterval(int interval)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And as the documentation says: &lt;em&gt;Servlet: This must call setMaxInactiveInterval on the underlying javax.servlet.http.HttpServletRequest instance.&lt;/em&gt;. The jsf context implementation will modify the session timeout on the http session.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Suter</dc:creator><pubDate>Mon, 03 Apr 2017 16:05:05 -0400</pubDate><guid>https://answers.axonivy.com/questions/2556/how-to-extend-a-user-session-time-programmatically/2562</guid></item></channel></rss>