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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:40:59+00:00 2026-06-01T23:40:59+00:00

We have a form on our website in which a user can fill out

  • 0

We have a form on our website in which a user can fill out and submit. Sometimes, they take longer to fill out the form than our 20 minute session timeout.

So, I have written functionality to pop up a message 2 minutes before timeout to warn the user, with an option to save and continue (which renews the session). If the warning is left, it will Autosave their work and log them out after 2 minutes.

If the message is ignored, it Autosaves the work and logs them out fine. If they click save and continue it saves fine, and the message pops back up after a further 20 minutes (while testing I’ve reduced the time), however, subsequent times, it does not log them out after a further 2 minutes if it’s ignored.

Here is the JavaScript I have written. Can anyone see any issues?

init(); is called onLoad in the <body> tag.

var logoutTimer = setTimeout('saveAndLogOut();', 1000 * 60 * 1.5);

function init() {
    setTimeout('expirationWarning();', 1000 * 60 * 1);
    logoutTimer;
}

function expirationWarning() {
    $('#session-expiry-warning').dialog({ 
        show: 'fade', 
        hide: 'fade',
        title: 'Your session is about to expire...',
        buttons: { 
            "Save and Continue": function() { 
                ajaxSave('saved');
                clearTimeout(logoutTimer);
                init();
                $(this).dialog("close");
            }
        },
        width: 550,
        closeOnEscape: false,
        open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }            
    });
}

function saveAndLogOut() {
    ajaxSave('autosaved');
    setTimeout("parent.document.location.href = '../logout.asp';", 5000);
}

Thanks in advance.

  • 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-01T23:41:00+00:00Added an answer on June 1, 2026 at 11:41 pm

    logoutTimer is only set once, in the first line of code that you’ve pasted. If the user clicks “Save and Continue”, logoutTimer will be cleared. At no point will it be set to anything again.

    Did you intend to set the timer in init()? It currently just says logoutTimer; there, which doesn’t really do anything. If you want the timer to be re-set at this point, you would need to include the entire setTimeout command in init.

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

Sidebar

Related Questions

I have a form that a user would fill out while creating a ticket
I have a project to setup an anonymous feedback form to our website. I
I have form where user submits field. Field can have letters, numbers, and punctuation.
We have a simple registration form for our website users where we only require
We have several wizard style form applications on our website where we capture information
I have a login form on our new website design, and it has a
Post-release, I have made one small change to one form in our development site
I have form, where some fields are looks like rows, so I can add/delete
i have form with user data to input and javascript ajax to send information
I have a form which includes a JQUERY datepicker attatched to an <input> on

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.