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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:00:26+00:00 2026-05-27T08:00:26+00:00

I have an web app in C# and after 20 mins the session times

  • 0

I have an web app in C# and after 20 mins the session times out. I can’t change this because other apps use the same config.

So I am checking to see if the Session is NULL and if it is. It redirect and adds a QueryString with the Session ID. The problem I am having is when the Session times out the SessionID because NULL. Is there anyway to still get the sessionid after the timeout?

Thanks!

  • 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-27T08:00:27+00:00Added an answer on May 27, 2026 at 8:00 am

    No, once the session is gone, it is gone for good.

    However, if you have control over the web pages, you can create a keep-alive mechanism in javascript by calling back to a simple ping method in an ashx page that implements IRequiresSessionState. Will update with an example momentarily.

    Here’s the javascript that we use (note that this warns the user about the timeout, but it could easily just perform a non-posting query):

    var m_TimeoutWarningID = null;
    function ResetSessionTimeoutWarning() {
        try {
            // Clear the previous timeout warning, if any
            if (m_TimeoutWarningID != null) {
                window.clearTimeout(m_TimeoutWarningID);
            }
            // If the caller has set the session expiration minutes, and it is not 0, initialize the timer
            if ((typeof m_wSessionTimeoutWarningMinutes !== 'undefined') && (m_wSessionTimeoutWarningMinutes != 0)) {
                // Pass the expiration minutes to the called method in case something happens to the var between 
                // now and the time the method is executed.
                m_TimeoutWarningID = window.setTimeout("SessionTimeoutWarning(" + m_wSessionTimeoutWarningMinutes + ")", m_wSessionExpiresInMinutes * 60000);
            }
        } catch (ex) {
            alert('Javascript Error (ResetSessionTimeoutWarning)\r' + ex.message);
        }
    }
    
    function SessionTimeoutWarning(wSessionTimeoutWarningMinutes) {
        if (window) {
            window.focus();
        }
        // Don't worry about exceptions here
        if (window) {
            window.focus();
        }
        if (confirm("Your login session will expire in " + wSessionTimeoutWarningMinutes + " minutes. Please press Ok within this time period to confirm you are still working.")) {
            // Send a request back to the server to renew the session timeout
            ResetSessionTimeout();
    
            // Reset the session timeout warning now
            ResetSessionTimeoutWarning();
        }
    }
    

    In the above example, m_wSessionTimeoutWarningMinutes and m_wSessionExpiresInMinutes are set in server side code along with an initial call to ResetSessionTimeoutWarning().

    ResestSessionTimeout performs an ajax request against an ASHX page that implements IRequiresSessionState just to keep the user’s session alive.

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

Sidebar

Related Questions

I have this .NET web app that draws a table in Page_Load. Then after
I have a web app that only registered users can use, therefore I should
I have a web app hosted in a cloud environment which can be expanded
I have a web app which pulls in information via ajax after the page
I have this web app at the http://autozeep.com/cars each car have it's link to
I have a simple web-app with Database with two tables. The administrators can modified
I have user log in logic in my web app. after successful log in,
I have mvc web app i need to use captcha , i did it
I have a little web app that uses the Facebook like widget. This page
I have a web app, where people can search for stuff. In IE9 the

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.