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

The Archive Base Latest Questions

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

I use setInterval with an ajax call to check for new messages every minute.

  • 0

I use setInterval with an ajax call to check for new messages every minute. This call extends authentication cookie (because I have slidingExpiration set to true), thus authentication never expires.

This question had similar issue, but the solution is for class .net project and I can’t see how I can apply it to my MVC project.

It would be nice if a solution was in a form of an attribute like [DoNotExtendAuthentication] which I could slap on an action, but any help is appreciated.

  • 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-18T02:05:22+00:00Added an answer on June 18, 2026 at 2:05 am
    public class DoNotExtendAuthenticationAttribute : ActionFilterAttribute
    {
        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            filterContext.HttpContext.Response.Cookies.Remove(
                FormsAuthentication.FormsCookieName
            );
        }
    }
    

    and then:

    [Authorize]
    [DoNotExtendAuthentication]
    public ActionResult SomeAction()
    {
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a timer every 20 seconds using setInterval, it uses jQuery's ajax function
I've tried to use setinterval to allow my ajax request to send every 2
i cant use setInterval mehod, i don't know why. what's wrong with this script,
I have a function that use setInterval() method to watch css propertie change('cause in
I'm trying to use this with tabs that load content with ajax into a
I have a page that automatically refreshes content via Ajax. I want this to
I have this string variable call status which is updated by a serial port
I have saved this as an ajax.js file: function sendAjax(type, str) { var xmlhttp;
I am currently using this script to get new data every second from record_count.php
I have this in the <head> <script src=https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js></script> And this for some fadein/fadeout of

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.