掲示板

Extend Portal session

1年前 に Anamica Liferay によって更新されました。

Extend Portal session

Junior Member 投稿: 39 参加年月日: 09/10/07 最新の投稿
Hi

We have Flex portlets in liferay. These flex portlets communicate with DB n stuff...

My issue is this..

Even if we keep working in the portlet the session expires. I get the message saying the session is about the expire in sometime and session expires.. emoticon

So we tried to call a servlet to get the logged-in user id to make sure we access liferays session.. Still no change..emoticon

I need to keep liferay session active while working in my flex portlet.. Since the user is active in the screen.. There it makes no sense expiring session.. right???emoticon

Can nebody help me?

Thanks in advance.
Lilford
thumbnail
13年前 に Shagul Khajamohideen によって更新されました。

RE: Extend Portal session

Liferay Master 投稿: 758 参加年月日: 07/09/27 最新の投稿
1年前 に Anamica Liferay によって更新されました。

RE: Extend Portal session

Junior Member 投稿: 39 参加年月日: 09/10/07 最新の投稿
Shagul Khajamohideen:
The below post may help.
http://www.liferay.com/community/forums/-/message_boards/message/4595380


The above URL was very helpful... Thanks a bunch.. Here is the code I used in JSP to extend the session..


function extendSession(){
try { if ('noWarning' == mySessionRenewAtWarning()) { mySessionRenew(); } } catch(e) {} 
}

//Closes the warning by invoking the click event of extend button...

function mySessionRenewAtWarning(){
    var jqryWarn = new jQuery;
    var warnElm = jqryWarn.find('.popup-alert-notice');
    if (warnElm.length > 0) {
        // Match content of warning with session expiration warning language
        if (Liferay.Language.get('warning-your-session-will-expire').indexOf(warnElm[0].firstChild.nodeValue) == 0) {
            // click the extend button
            warnElm.find('.popup-alert-close').click();
            return true;
        }
    }
    return "noWarning";
}

// Extends the session and resets the client timer
function mySessionRenew() {
    if (Liferay.Session._stateCheck) {
        window.clearTimeout(Liferay.Session._stateCheck);
        Liferay.Session._stateCheck = null;
    }
    Liferay.Session.extend();
}


However I have another issue now.. I get an alert without any message.. I just have a close and the red alert icon.. Clicking on close does nothing.. The alert keeps coming..
This appears only in one screen!!!!emoticon
1年前 に Anamica Liferay によって更新されました。

RE: Extend Portal session

Junior Member 投稿: 39 参加年月日: 09/10/07 最新の投稿
Got that working too guys..

Had to set autoExtend true

Liferay.Session.autoExtent = true;

before calling

Liferay.Session.extend();

Thanks again for the help.. emoticon
9年前 に Azhar md によって更新されました。

RE: Extend Portal session

Junior Member 投稿: 59 参加年月日: 14/12/01 最新の投稿
Hi Lilford Immanuel Arthur,

Got that working too guys..

Had to set autoExtend true

Liferay.Session.autoExtent = true;

before calling

Liferay.Session.extend();

Thanks again for the help..


How u got working kindly help
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: Extend Portal session

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Seriously? You see the dates on this thread are 5 years old?

Cross posting to all threads related to liferay session extension is not going to answer your question any sooner...
8年前 に Annushree Satpathy によって更新されました。

RE: Extend Portal session

New Member 投稿: 1 参加年月日: 16/01/19 最新の投稿
Hi David,

I read your post on another thread on liferay session expiry
https://www.liferay.com/community/forums/-/message_boards/message/47381705

I have used the Liferay.Session.extend() in the script for the session extension. My question is after adding this, even after 30 mins of idle time, no session expiry message displayed in the portlet. Is this the right behaviour?
12年前 に Nisarg Parikh によって更新されました。

RE: Extend Portal session

Expert 投稿: 262 参加年月日: 09/12/31 最新の投稿
Hey,

I am facing the same problem, but I am not sure where to write that code.

I have one java script file in which I have written the code to extend the Liferay Session but in which Flex file I have to write a code to call that java script function?

Can you please give me file structure and in which Flex file I have to write? Is there any event interceptor or any other mechanism?

Thank you in advance.

-Nisarg
11年前 に Paul Butenko によって更新されました。

RE: Extend Portal session

Junior Member 投稿: 38 参加年月日: 10/07/02 最新の投稿
Hello
I have similar problem but for AJAX portlet, here I described how I solved it.
Maybe it can guide you in right direction.

BR,
Paul Butenko
thumbnail
11年前 に Olaf Kock によって更新されました。

RE: Extend Portal session

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
for portal-ext.properties:
    #
    # 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
    # browser is open and 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
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Extend Portal session

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Solutions probably differ from the previous thread because this is an old thread. Another reason not to replies to old threads because solutions may changes between versions. emoticon
thumbnail
11年前 に Olaf Kock によって更新されました。

RE: Extend Portal session

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
correct in general. However, this option is old, probably also applies to the first problem (I just browsed through that quickly). All in all the questions sounded very similar and I don't want someone to modify code if there's a simple solution like this.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Extend Portal session

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Sorry, my comment was more directed to Paul. I thought you were just replying to his post.