Forums de discussion

Sign Out Method

Julien Mimin, modifié il y a 13 années.

Sign Out Method

New Member Publications: 7 Date d'inscription: 18/08/10 Publications récentes
I 'm using liferay-portal-5.2.3 with Tomcat 6.0.18
I would like to be able to make the user sign out of liferay automatically when the session expires. So, I am wondering, is there a method to do this?
Thank you in advance
thumbnail
Corné Aussems, modifié il y a 13 années.

RE: Sign Out Method

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
AFAIK When the session expires the user will be signed out!
and needs to sign in again if he does not have the remember me checked/available.
Warning! Due to inactivity, your session has expired.
Julien Mimin, modifié il y a 13 années.

RE: Sign Out Method

New Member Publications: 7 Date d'inscription: 18/08/10 Publications récentes
In my application, when the session expires, the user can continue to use the interface. This happens probably as you said due to the "remember me" browser option. The thing is that despite the new session, the user can use the application and some problems arise there. Should I just turn off the "remember me"?
I still think that I should be able to make the user sign out also when he has enabled the "remember me" option. The users are not supposed to be experts in in that kind of stuff, right emoticon
thumbnail
Corné Aussems, modifié il y a 13 années.

RE: Sign Out Method

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
Depending on your problem i think you should solve it within your portlet by catching the absence of a session attribute wich triggers a cleanup for your application.
Julien Mimin, modifié il y a 13 années.

RE: Sign Out Method

New Member Publications: 7 Date d'inscription: 18/08/10 Publications récentes
Yes, I could do that but since it is a bit complicated and I don't know the whole application so well, I would prefer to have the option of sign out. I catch the absence of session; if there was such a method of sign out, I could use it and - problem solved.
thumbnail
Corné Aussems, modifié il y a 13 années.

RE: Sign Out Method

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
Maybe you could extend the Logout mechanisme of Liferay and do the thing you need

    #
    # Logout event
    #
    logout.events.pre=com.liferay.portal.events.LogoutPreAction
    logout.events.post=com.liferay.portal.events.LogoutPostAction,com.liferay.portal.events.DefaultLogoutPageAction,com.liferay.portal.events.SiteMinderLogoutAction
    #logout.events.post=com.liferay.portal.events.LogoutPostAction,com.liferay.portal.events.GarbageCollectorAction

Julien Mimin, modifié il y a 13 années.

RE: Sign Out Method

New Member Publications: 7 Date d'inscription: 18/08/10 Publications récentes
I copied the lines you posted in the file portal-ext.properties in the classes folder of the war file. There is nothing else in the file. I redeployed and restarted liferay. Still, when the session expires, the application uses a new session id and does not sign out. It continues to work with the new session id. Is there something else I could do or did I do something wrong?
Thank you for your replies
thumbnail
Corné Aussems, modifié il y a 13 années.

RE: Sign Out Method

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
You should write your own implementation of LogoutPostAction
and register this in the portal-ext.properties;

at this moment you enabled the LogoutPost actions that are enabled by default
ie;

logout.events.post=com.foo.YourLogoutPostAction,com.liferay.portal.events.LogoutPostAction,com.liferay.portal.events.GarbageCollectorAction
Julien Mimin, modifié il y a 13 années.

RE: Sign Out Method

New Member Publications: 7 Date d'inscription: 18/08/10 Publications récentes
And what does that mean? What do I write in this LogoutPost class? I have a SessionListener class which listens and catches the session destruction. How is this related? Excuse me for my luck of knowledge!
Thanks again
thumbnail
Corné Aussems, modifié il y a 13 années.

RE: Sign Out Method

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
I'm sorry that i'm not clear, This because i don not know the exact problem you have.
If you have a SessionListener, i guess a logoutevent won't help you either.