In my ASP.NET MVC application there is a periodical ajax call to fetch new notifications for the current user. However this call resets the idle timeout for the current session, causing the session to never expire. This is a security risk. How can I prevent certain endpoint calls from resetting the idle timeout?
Prevent session timeout from resetting for periodical ajax calls
544 Views Asked by Robbinb1993 At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in ASP.NET
- Implementing Azure AD B2C Authentication in .NET 8 Blazor Project (RenderMode: InteractiveAuto)
- Azure Application Insights Not Displaying Custom Logs for Azure Functions with .NET 8
- IIS Rewrite Module exclude bots but allow GoogleBot
- Angular 16 sending null values to API
- I am the domain admin, newbie, how do I connect youtube.com on my domain?
- Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of Active Directory group name in ASP.NET MVC C#
- ASP.NET Identity, Losing Ability to Login until Application Pool Recycles
- How to unprotect ASP.NET FormAuthentication cookie
- How does it work using ASP.NET FormAuthentication
- What is the purpose of a completely standalone 'this'?
- Is there a way to read .csproj PropertyGroup variable in c#
- MSBuild trying to copy different dll with similar name into project sporadically
- Minimizing IdentityServer4 Round Trips in Microservice Architecture with Ocelot
- Azure AD guest account in web app authentication user claims data
- Receiving 400 bad request on post when customer auth handler is used
Related Questions in ASP.NET-MVC
- I have a problem outputing the roles on the page ListRoles.cshtml
- Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of Active Directory group name in ASP.NET MVC C#
- Hosting ASP.NET MVC application on IIS web server using Windows 2019 server
- How to display only department fields associated with a selected department in student automation system?
- How to send select input data for form submission?
- Multi level project reference using dll
- How to upload file to Onedrive using ASP.NET MVC?
- ASP.NET MVC web app looping between fields only on some devices
- Is there any automatic job to load AD-groups?
- How to restrict admin js files to download
- Download PDF in ASP.NET MVC application
- How to add bootstrap theme/example into ASP.NET MVC 5?
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- ASP.Net Core 7.0 Web App (Model-View-Controller) ErrorViewModel OnGet OnPost do not get called or executed
- OAuth 2.0 keep getting Authorization has been denied for this request
Related Questions in ASP.NET-CORE-2.1
- How to update ASP.NET Core 2.1 (running on .NET Framework) to newer builds?
- How to receive Json parameters from post request as JObject in ASP.NET Core 8.0 controller?
- API does not store keys from IdentityServer to validate tokens
- CreateNewOnMetadataUpdateAttribute does not exists in the namespace after Visual Studio update
- HTTP Error 500.32 - ANCM Failed to Load dll
- ILoggerFactory does not contain a definition for addconsole
- Set HttpClient Basic Auth Header per client on backchannel logout in IdentityServer4 2.5.4 (.Net Core 2.1)
- .NET Core 2.1 Authorization based on Active Directory
- Microsoft upgrade assistance tool : can I use this tool to upgrade ASP.NET Core 2.1 Web API to .NET 6?
- Js file throwing an error after .net framework upgraded to 6.0
- Register Generic Interface in Startup in ASP.NET Core 2.1
- IdentityServer 4, Backchannel-Logout, Reject Logout-Token, Bad Request
- .NET Core Razor pages change pages to anonymous
- How to add logging.AddEventSourceLogger() in F#
- The LINQ Expression 'DbSet<> Could not be translated method 'System.DateTime.ToString' failed, After Migrated from ASP.NET Core 2.1 to .NET6
Related Questions in .NET-CORE-2.1
- Is there a solution to auto-update a .NET Core 2.1 console app project?
- .NET Core 2.1 Authorization based on Active Directory
- How can I find where a specific SDK dependency is coming from in a dotnet core solution that fails to build because of it?
- How to catch global exceptions in the version of .NET Core 2.1
- Error: The reference assemblies for ".NETFramework,Version=v6.0" were not found
- How do I migrate this into my .NET 6 Program.cs file without using the startup class? The code is from .NET Core 2.1, also in Program.cs
- How to use 'MapControllers' in ASP.NET Core 2.1
- How to remove URI extra slash when I converted NSUrl to URI
- Azure AD after successfully logging in with Mobile, it gets stuck on a white blank screen
- Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzer threw an exception of type 'System.NullReferenceException'
- Serilog has no method ".ForContext ()"
- .NET Core 2.1 and .NET Core 5.0 Web-Apps on Same Server
- Selenium Sendkeys contain <ul><li> tag into textarea
- Prevent session timeout from resetting for periodical ajax calls
- Preventing access to concurrent queue while rebuilding
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Session state in ASP NET Core is maintained by
SessionMiddleware, it is design is pretty simple. I will omit starting part where session is loaded, you are interested in this part where next middleware calls are wrapped in such way.So if you are accessing session read-only you can just not commit it when you are hitting your periodical endpoint, you can figure it out from
HttpContext context. If you prevent block of code that commits session from execution it will not put new entry inIDistributedCacherenewing it's sliding expiration and session will remain unaltered.You also have to write analogue of
SessionMiddlewareExtensionsclass whereUseSessionextension method is defined and provide your own implementation registering your custom middleware.