Forums de discussion

How to Disable session time out in Liferay

Arihant Dangi, modifié il y a 10 années.

How to Disable session time out in Liferay

New Member Publications: 4 Date d'inscription: 19/11/12 Publications récentes
I want to disable session time out in Liferay.

I have added properties in portal-ext.properties file

session.timeout.warning=0
session.timeout.auto.extend=true
session.timeout.redirect.on.expire=false

Also made changes in web.xml and set session-timeout to 0 ,
under "liferay-portal-6_1_20-ee-ga2-20120731110418084_war.ear\liferay-portal-6.1.20-ee.war\WEB-INF\"

<session-config>
<session-timeout>0</session-timeout>
</session-config>

But my session is getting time out after 30 minutes.

I am using Liferay EE 6.1 on WebSphere 7.0.

I also set the Session timeout: value in WAS to No timeout, but No success.

Any help would be greatly appreciated.

-Arihant
thumbnail
Varsha ., modifié il y a 10 années.

RE: How to Disable session time out in Liferay

Regular Member Publications: 187 Date d'inscription: 05/03/12 Publications récentes
Check out here.. http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/session

it specifies the error that you have made.
Arihant Dangi, modifié il y a 10 années.

RE: How to Disable session time out in Liferay

New Member Publications: 4 Date d'inscription: 19/11/12 Publications récentes
Thanks Varsha,

Can you please highlight the error in my approach.

I looked in the the link you have shared, but could not found the issue.

-Arihant
thumbnail
Varsha ., modifié il y a 10 années.

RE: How to Disable session time out in Liferay

Regular Member Publications: 187 Date d'inscription: 05/03/12 Publications récentes
You have to specify the property

form the Session user guide-:

Set the auto-extend mode to true to avoid having to ask the user whether to extend the session or not. Instead, it will be automatically extended. The purpose of this mode is to keep the session open as long as the user’s browser is open with a portal page loaded. It is recommended to use this setting along with a smaller session.timeout, such as 5 minutes, for better performance.

session.timeout.auto.extend=false


that will do it.
Hope this help. :-)
Ryan Perreault, modifié il y a 10 années.

RE: How to Disable session time out in Liferay

New Member Publications: 2 Date d'inscription: 12/10/12 Publications récentes
I am having the exact same issue.

Liferay 6.1.1, Tomcat 7

Our web.xml is setup for 500 minutes and I also have the following properties:

session.timeout=500
session.timeout.warning=1
session.timeout.auto.extend=false

However - Timeout is 30 minutes, plus the warning is sporadic at best. Sometimes they see it, sometimes they don't.

is there anyway to see what value is being pulled?

Edit: I've also turned on auto extend to no luck.
thumbnail
Gayathri Palicherla, modifié il y a 10 années.

RE: How to Disable session time out in Liferay

New Member Publications: 19 Date d'inscription: 07/03/13 Publications récentes
When I came across this issue, I wasn't updating correct web.xml
are you updating the one in this location? liferay home directory\tom cat folder\webapps\your portlet project directory\WEB-INF
this is the correct one, and restart server for it to pick this new change and then test it.

Hope this helps.
thumbnail
Aditya Bhardwaj, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 78 Date d'inscription: 08/01/15 Publications récentes
Gayathri Palicherla:
When I came across this issue, I wasn't updating correct web.xml
are you updating the one in this location? liferay home directory\tom cat folder\webapps\your portlet project directory\WEB-INF
this is the correct one, and restart server for it to pick this new change and then test it.

Hope this helps.



No Gayathri i tried this this will not work .I am using Lifeary6.2
thumbnail
Aditya Bhardwaj, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 78 Date d'inscription: 08/01/15 Publications récentes
Hi All


As mention in portal.properties file

#
# Specify the number of minutes before a session expires. This value is
# always overridden by the value set in web.xml.
#
session.timeout=30

When you define any value in portal-ext.properties this is over rided by web.xml which is always 30 so just comment out
<session-config>
<session-timeout>30</session-timeout>
</session-config>
from web.xml

And provide entries in portal-ext.properties
session.timeout=1
session.timeout.warning=1

Then session is timeout in every minute you can control time out by changing values in portal-ext.properties file
Eswaran R, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 82 Date d'inscription: 29/12/14 Publications récentes
hi friends ....

i am using portlet page but tomcat session timeout 30 min ...
so portlet page session timeout ..
how to increase session timeout in portlet page ...

"Warning! Due to inactivity, your session has expired. Please save any data you may have entered before refreshing the page."

how to solve ....???
kindly help me...

Regards ...
Eswaran.R
Eswaran R, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 82 Date d'inscription: 29/12/14 Publications récentes
Hi,,
my portlet page using at the time session timeout...

how to solve this error ????

my portlet page idle session timeout but now i am using portlet page at the time session timeout ....
thumbnail
mohiden abdul kader, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 38 Date d'inscription: 08/08/12 Publications récentes
Eswaran R:
Hi,,
my portlet page using at the time session timeout...

how to solve this error ????

my portlet page idle session timeout but now i am using portlet page at the time session timeout ....



Hi Eswaran,
Its not straight forward.
We have to do configure in the jsp page to extend the session timeout
.I have extend the session timeout for CAS Integration with Liferay.By Extending the session timeout length in the following file

liferay-portal-6.2.0-ce-ga1/tomcat-7.0.42/webapps/ROOT/html/common/themes/session_timeout.jspf

In that file modify the AUI -Script session value to ==> sessionLength: <%= sessionTimeout %>,.

change the sessionTimeout length to your prefered time.

Thanks & Regards,
Abdul Kader
Eswaran R, modifié il y a 9 années.

RE: How to Disable session time out in Liferay

Junior Member Publications: 82 Date d'inscription: 29/12/14 Publications récentes
hi abdul kader ,,

first of all thanks...

i am create jquery function then extend the session timeout my portlet war page ...

coding ....

$(document).ready(function(){
console.log("welcome MDT");

var t;
window.onload = resetTimer;
window.onmousedown = resetTimer; // catches touchscreen presses
window.onclick = resetTimer; // catches touchpad clicks
window.onscroll = resetTimer; // catches scrolling with arrow keys
window.onkeypress = resetTimer;

function logout() {
alert("Session expired. You will be redirected to login page");
window.location.href = '/c/portal/logout';
}

function resetTimer() {
clearTimeout(t);
console.log("Liferay Session Extend!!!");

Liferay.Session.autoExtend = true;
Liferay.Session.extend();
//liferay session timeout extend ...

t = setTimeout(logout, 30*60*1000); // time is in milliseconds session timeout 30 minute
}

});


Thanks to reply ....

Regards ..

Eswaran.R