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 7069899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:30:06+00:00 2026-05-28T05:30:06+00:00

We are working with a Single Sign On provider to do a web app

  • 0

We are working with a Single Sign On provider to do a web app that needs to include an image url on every page to keep their session alive. This would work great if it were a standard web app with multiple pages, but we are making it a single page app built on extjs.

Looking for ideas on how to keep the session alive based on user activity when we won’t be requesting pages that contain the “tracking pixel” they currently use since all our server interaction will be json/ajax based and most of it will be using sencha’s Ext Direct for most of the client to server communications. Surely someone else has done this. Session inactivity timer is on the order of 10 minutes.

Just wondering if anyone else has run into this, and how you handled it. I can prevent the session timeout easy enough with a setInterval call, but that sort of defeats the whole purpose of the inactivity timer.

  • 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-05-28T05:30:07+00:00Added an answer on May 28, 2026 at 5:30 am

    So the point is to detect if user has done something on the page in a period and if so, make a call to keep his session alive.

    My idea is whenever user does something, record the time that the activity happens. And a check function will be invoked regularly to determine if a make-session-alive call should be made.

    First, keep two global variables:

    //The time when last make-session-alive call is made.
    var lastSyncTime = new Date().getTime();
    
    //The time when user did something on the page. Reassigned per user activity.
    var lastActiveTime = lastSyncTime;
    

    Second, add listeners to record user activity time:

    function recordFn(){
       lastActiveTime = new Date().getTime();
    }
    
    //If there's a lot of clickable stuff, add a click listener to the container
    Ext.getBody().on('click', recordFn);
    
    //If there's a lot of input stuff
    Ext.getBody().on('keypress', recordFn);
    
    //If ajax call should be detected
    Ext.Ajax.on('beforerequest', recordFn);
    

    Last, regularly call the check function:

    SessionExpiredTime = 1000 * 60 * 10; //ten minutes.
    function checkFn(){
       if( lastActiveTime - lastSyncTime < SessionExpiredTime ){
         //Make Ajax call to refresh session...
    
         //Reassign
         lastSyncTime = new Date().getTime();
         lastActiveTime = lastSyncTime;
       }
    }
    setInterval(checkFn, SessionExpiredTime - 1000 * 60);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I'm working on a single page web app that loads everything through AJAX
I am working on a single sign-on login page using Shibboleth that will be
I am working on an asp.net web site that is based upon a single
I'm working on a project that will have a single table holding lots and
I'm working on a .net solution that is run completely inside a single network.
I am working with a legacy database that stores blank values as a single
I'm working on a Single Sign On solution to allow my company to integrate
I've been working on a project which uses SPNEGO to have Single Sign On
I've integrated my website with Facebook Connect, authorization/single-sign on all working great. Now im
Hi All I am working on a single sign on system which a load

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.