Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:14:22+00:00 2026-06-03T13:14:22+00:00

I created a portlet that uses AJAX every function. That is, the portlet is

  • 0

I created a portlet that uses AJAX every function.
That is, the portlet is only rendered once and i didnt utilize processAction or the like.

Is there a way to extend the user’s session using built in Liferay function using javascript?

I tried

Liferay.Session.extend();

but it does not seem to work..

I also tried a solution in the ICEfaces forum, which is

    if (Liferay.Session._stateCheck) {
           window.clearTimeout(Liferay.Session._stateCheck);
           Liferay.Session._stateCheck = null;
         }
         Liferay.Session.init({
           autoExtend: false,
           timeout: Liferay.Session._timeout,
           timeoutWarning:  Liferay.Session._warning
           });jQuery.ajax({url: Liferay.Session._sessionUrls.extend});

also not working..

I put those blocks of code whenever the user clicks a button

Any tip would greatly help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:14:25+00:00Added an answer on June 3, 2026 at 1:14 pm

    I had same issue and solved it.
    The main idea is to override session.js into ext-plugin, and add some additional method:

    extendExternal: function() {
      var instance = this;
    
      if (instance != undefined) {
        instance.extend();
      }
    }
    

    also setCookie method should be updated:

     setCookie: function(status) {
       var instance = this;
    
       var currentTime = new Date().getTime();
    
       var options = {
          secure: A.UA.secure,
          path: "/"
       };
    
       A.Cookie.set(instance._cookieKey, status || currentTime, options);
     }
    

    In order to use the same cookie path for each page.

    And some global ajax event can be used for ‘automatical’ call of extendExternal method:

    AUI().use('event', function(A){
     A.on('io:start', function(transactionid, arguments){
       if (Liferay.Session._cookieKey != undefined && Liferay.Session._cookieKey != null) {
         if (arguments != 'sessionExtend') {
           Liferay.Session.extendExternal();
         }
       }
     });
    });
    

    in this case extend method have to be updated with:

    // added in order to differentiate session extend ajax calls and other ajax call, to     avoid infinit loop
     A.io.request(instance._sessionUrls.extend, {
        arguments: 'sessionExtend'
     });
    

    You can check solution here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a portlet that is deployed as WAR. Database models are created by
I have created a my-services-portlet in which i have AbcService, which I am calling
I'd like to create a Window Service that can load several DLLs from a
I've created simple Hello world portlet and just added <use-default-template>true</use-default-template> to the portlet section
Created a custom validation attribute and I would like to get it to work
Created new scaffold Users that has fields name & description All working as suppose
Created a AlertDialog that is used to prompting the user to enter a keyword.
I've created a portlet product to tie in an outside chat system. I use
I create portlets and there can be many instance of a portlet on a
We have created a portlet. We then went through some pain to move images

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.