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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:18:21+00:00 2026-05-24T02:18:21+00:00

I have a webforms app that uses a few ASP.NET AJAX Timer controls (i.e.

  • 0

I have a webforms app that uses a few ASP.NET AJAX Timer controls (i.e. polling). If a user is on a page with one of these, they will effectively never time-out, as the polling process keeps their authentication ticket alive.

I’d like to segment Timer controls so they don’t trigger Forms Authentication’s RenewTicketIfOld method. The path I’m on and I’ve done something similar before is to inject something into the AJAX HTTP request to have these requests identified as coming from a timer and then put some code to run after the Forms Authentication Module that hides the Authentication cookie from being sent back down in the response.

Any other suggestions for how to prevent a Timer control from keeping the forms authentication ticket alive?

  • 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-24T02:18:21+00:00Added an answer on May 24, 2026 at 2:18 am

    Making progress, currently this is my solution. I went from setting a custom header in the Timer AJAX requests and checking that header in a Module (you can see this in the answer version history) to a simple, Module-only solution. (Hat tip to the How to tell if a refresh came from a Timer question)

    public class SkipAuthTicketRenewalModule : IHttpModule
    {
        public void Init(HttpApplication context)
        {
            context.EndRequest += new EventHandler(context_EndRequest);
        }
    
        void context_EndRequest(object sender, EventArgs e)
        {
            // See if auth cookie was added in response to the timer control update by the FormsAuthModule, 
            // indicating the ticket was renewed.  If it was, remove it so we don't extend the ticket.
    
            HttpContext ctx = HttpContext.Current;
            string ctrlname = ctx.Request.Params.Get("__EVENTTARGET");
    
            if (!String.IsNullOrEmpty(ctrlname))
            {
                Page page = ctx.Handler as Page;
                if (page != null)
                {
                    Control ctrl = page.FindControl(ctrlname);
                    if (ctrl != null && ctrl is Timer)
                    {
                        ctx.Response.Cookies.Remove(FormsAuthentication.FormsCookieName);
                    }
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working
I have a reporting module in an ASP.NET webforms app (C#) that uses dynamic
I have an asp .net webforms app that uses forms authentication. For a small
I have an ASP.Net webforms app, that uses Ninject 2.2.0.0 I have a HTTPHandler
I have a asp.net web forms app that uses System.Web.Caching.Cache to cache xml data
I have an ASP.Net webforms application that uses the .Net globalization features to deliver
I have an ASP.net webforms app that connects to a web service, All the
I have inherited a working VB.NET 2.0 web app that has several User Controls
I've got an old WebForms-based ASP.NET app that I have upgraded to ASP.NET 4.0
I have a simple web app built in asp.net webforms c# where and how

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.