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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:24:22+00:00 2026-05-12T08:24:22+00:00

I have a hidden iframe that refreshes every now and then, in order to

  • 0

I have a hidden iframe that refreshes every now and then, in order to keep the ASP.NET session up and running, for as long as the user is online.

However, I have been getting reports of users experiencing session timeouts, so now I am in doubt of what is needed to reset the session timer.

The hidden iframe’s content page (simple html page) refreshes itself at a certain interval, which is significantly less than the session timeout.

My question is: Is it enough (for the session timer to reset) to let the page refresh itself, even when the server responds with a HTTP/1.x 304 Not Modified?

Is it simply the GET request itself that tells the webserver to reset the session timer?

Or do I need to make sure to actually fetch the page and receive a HTTP/1.x 200 OK response?

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

    All you have to do to keep the session alive is send a request to a page from the current session. You can do this via iframes, or via ajax.

    If you simply refresh the page in the IFrame, the response may be a cached one – thus the 304. You have to send a fresh request every time –

    var url = "http://domain.com/defibrillator.aspx?" + (new Date()).getTime();
    

    E.g.

    http://domain.com/defibrillator.aspx?1556467987987
    http://domain.com/defibrillator.aspx?5448796497878
    http://domain.com/defibrillator.aspx?4123165487987
    ....
    

    EDIT 1

    Or you can use the Refresh HTTP header attribute.

    EDIT 1.1

    If you are using the codeproject article mentioned above, then try to model it using AJAX instead of iframes – it would save you a few bytes of extra iframe markup.

    EDIT 2 – About HTTP 304 Not Modified

    If the client has performed a
    conditional GET request and access is
    allowed, but the document has not been
    modified, the server SHOULD respond
    with this status code. The 304
    response MUST NOT contain a
    message-body, and thus is always
    terminated by the first empty line
    after the header fields.

    This means that the request hasn’t reached the ASP.NET pipeline, and has directly been served by IIS itself. ASP.NET environment doesn’t know that a request has been made. So, it won’t perform the session renewal.

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

Sidebar

Related Questions

I have an ASP.NET application that implements keep-alive by using a hidden IFRAME with
I have an asp.net web app that is using an iFrame (called fraContent) within
I have an upload form that posts to a hidden iframe. I am attempting
I have a form that uses a hidden iframe to submit a file to
I have content loaded into a hidden iframe on a page and I'm wanting
I have an iframe in a tab with a hidden element, and I want
I have a hidden button on a form that I need to click in
I have a custom ASP.NET solution deployed to the ISV directory of an MS
We have an ASP.Net application hosted on our network and exposed to a specific
I have an iframe that has dynamic content. If the answers specific questions, additional

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.