voyent
Session expiration in Liferay  XML
Forum Index -> Portals & Portlets Go to Page: 1, 2, 3, 4 Next 
Author Message
vlotarev

Joined: 18/Apr/2007 00:00:00
Messages: 18
Offline


Dear guru!

It looks like Liferay doesn't understand AJAX-able activity inside ICEFaces based portlets and expires session after configured sesion timeout period (not taking into consideration user's activity).

Could your guys advice how to solve this problem?

Regards,
Vadim
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


If I had to guess, I would say that, because ICEfaces AJAX activity doesn't go through the portal container, then the portal container doesn't get an opportunity to "touch" the application-scoped user session. We do make use of the portlet-specific session but perhaps we need to also touch or use the application-scoped session in some way.

Maybe in your application it would help to reset the user session but adding or changing something artificial during a call to one of your beans (e.g. in one of your getters). It's definitely a hack but, if it worked, it would tell us if that's the problem. I'll investigate from my end and log a JIRA if I can pin it down.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
vlotarev

Joined: 18/Apr/2007 00:00:00
Messages: 18
Offline


Deryk,

Thank you for the reply. I'll try to do this but I believe that there is not a server-side problem only. Liferay has client-side (Java Script) code that monitors user activity, shows warnings and expires session if no activity is detected. Last access time is updated during each page refresh.

Most likely this functionality is the reason of the problem. It looks like it is possible to turn it off (though it looks rather convenient for end-users) but the best solution would be if you are able to invoke this (Liferay-specific) JS code after each AJAX request.
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


I'll take a look into the client-side aspect of Liferay's code.

However, if it's using the last accessed time as a value, then changing that value (by modifying something in the session) during each user interaction should work. We just have to "tickle" the correct session (user vs portlet).

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
vlotarev

Joined: 18/Apr/2007 00:00:00
Messages: 18
Offline


We looked at the Liferay code and solved this problem adding the following code after each AJAX request:

if (Liferay.Session._stateCheck) {
window.clearTimeout(Liferay.Session._stateCheck);
Liferay.Session._stateCheck = null;
}
Liferay.Session.init({
autoExtend: Eve.Liferay.Session.autoExtend,
timeout: Eve.Liferay.Session.timeout,
timeoutWarning: Eve.Liferay.Session.timeoutWarning
})

May be not the best solition but it seems to be working ...
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


I did some testing and one of the things I saw was that the lastAccessedTime of the session does not change when the session is accessed via ICEfaces Ajax communication. Our Ajax requests do not go through the portal container (Portlet.processAction) which is probably the reason why. We're talking about support for this as it impacts some other areas as well but it's a fairly major piece of work. I'm glad you found a work around in the mean time.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
vlotarev

Joined: 18/Apr/2007 00:00:00
Messages: 18
Offline


Well, this workaround just prevents session expiration performed by Liferay client-side code. If I understood corrrectly you found the problem on server-side. In this case this workaround is almost useless - session will expire anyway regardless of user activity.

Could you advise some workaround that prevents session expiration on server-side?
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


I misunderstood. The Liferay client code is not communicating with the back-end in any way so no requests are issued, correct? I'm still discussing this some of the other developers (both Liferay and ICEfaces) but at the moment, I don't have any kind of workaround - other than to set the session timeout as high as you can afford - which is not much of a workaround at all. I haven't found a way to update the session programmatically. It looks as if it's totally under the control of the portal container so unless a request is actually sent, it doesn't appear to work. A reload does it of course.

I'll likely be logging a JIRA for this shortly.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
vlotarev

Joined: 18/Apr/2007 00:00:00
Messages: 18
Offline


As far as I understand Liferay client-side code is able to invalidate session invoking some specific URL (..../expire_session.jsp).
ngriffin7a


Joined: 04/Dec/2006 00:00:00
Messages: 40
Offline


I sent an inquiry to Liferay's UI architect Nate Cavanaugh regarding this issue. At this time, you'll have to manually call some JavaScript like this:

Code:
ajaxButton.click(
     function() {
         Liferay.Session.setCookie();
     }
 );
Ragnarok

Joined: 27/Jan/2008 00:00:00
Messages: 12
Offline


Hi, here should i put the code you posted??? i can not fix the session expired message when doing a partial submit :(


Thanks a lot!!
maxi_ng

Joined: 11/Jan/2008 00:00:00
Messages: 92
Offline


is this problem solved in icefaces 1.7 stable?
alendl

Joined: 19/Feb/2007 00:00:00
Messages: 20
Offline


Hello!
We are trying to migrate a jsf 1.2 portlet application (Sun RI with facelets) to icefaces 1.7, but still have the “User Session Expired” problem in liferay. After the message shows up for the first time, you can’t get rid of it by pressing the “Reload” button (same with browser refresh or re-login).

How can we avoid this problem? Why is there no facelet/liferay version of the “component-showcase” sample available? Are there known problems with this combination?

TIA!

One more thing… the facelet version of the chat portlet sample can’t be built….

build.facelet.war:
BUILD FAILED
C:\work\frameworks\ICEfaces-1.7.0-bin\icefaces\samples\etc\build-common.xml:419: The following error occurred while executing this line:
C:\work\frameworks\ICEfaces-1.7.0-bin\icefaces\samples\etc\build-common.xml:161: Warning: Could not find file C:\work\frameworks\ICEfaces-1.7.0-bin\ic
efaces\samples\portlet\chat\conf\web.sunri.icefaces.facelet.xml to copy.
alendl

Joined: 19/Feb/2007 00:00:00
Messages: 20
Offline


Any news about this topic?
love2ez

Joined: 29/Apr/2008 00:00:00
Messages: 8
Offline


It would be nice if icefaces can provide some updates about this issue. From 1.7 release notes and JIRA, the session expired issue was marked as fixed, but it seems many people are still have some issues about it.
 
Forum Index -> Portals & Portlets Go to Page: 1, 2, 3, 4 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team