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

  • Home
  • SEARCH
  • 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 3229866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:51:37+00:00 2026-05-17T16:51:37+00:00

Is there any way to detect session timeout without (user interaction)*, and redirect it

  • 0

Is there any way to detect session timeout without (user interaction)*, and redirect it to some page; i.e. if there is no activity on page @ specific duration; server detects it and redirect it automatically on some other.

By user user interaction I mean; there is a way to detect session timeout when user clicks on something, then some request goes to server and then server checks if current user session is expired or not.

What I need here is that we don’t inform server anything (or we don’t perform any action), but when session expires server detects it automatically and perform required action.

Thanks,
Raza

  • 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-17T16:51:38+00:00Added an answer on May 17, 2026 at 4:51 pm

    You can of course do such a thing in JavaScript by implementing a document-wide keyboard and / or mouse listener and a periodical method with a timeout.

    var timeOut = 1000 * 60 * 30; // 30 minutes
    var lastActivity = new Date().getTime();
    var checkTimeout;
    checkTimeOut = function(){
        if(new Date().getTime() > lastActivity + timeOut){
            // redirect to timeout page
        }else{
            window.setTimeout(checkTimeOut, 1000); // check once per second
        }
    }
    

    now your global listeners just have to set lastActivity to the current time on every action.

    On re-reading the question, you want to use the actual session timeout from the application server. That’s a tough one, because your when you send ajax requests to the server you will actually keep the session from expiring (unless there is a hard limit), so my answer might still be the best way to do it.

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

Sidebar

Related Questions

Is there any way I can detect when my page has been set as
Is there any way to detect if the iPhone wakes up from sleep while
Is there a way to detect if a flash movie contains any sound or
Is there any way to check whether a file is locked without using a
Is there any way, in any language, to hook my program when a user
Is there any way I can detect if remote desktop is enabled on windows
Is there any way to detect if AdvancedDataGrid itemClick event is actually caused by
Is there any way to detect IE7? I don't have any problems with my
Hi is there any way to detect iPad keyboard hiding button ? i mean
Is there any way to detect the type from a given string input? Eg:

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.