'How to fix development error shown when the app turns to idle?
I'm having issues with my application made using asp.net core mvc 3.1 Error appears when user leaves the application (idle on browser),but there's also an instance when user leaves it for many hours without any issue.
However, often it shows error :
Error.
An error occurred while processing your request.
Request ID: 8a41058-4c61edceb1bf3fc2.
Development Mode
Swapping to Development environment will display more detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result and restarting the app. displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE ENVIRONMENT environment variable to Development
This app is locally deployed on LAN/Local Domain.
I'm skeptical about changing aspnetcore env to 'Production', if I change that variable is there any major changes on how the app run? I'm just new to ASP.NET Core. I also thought of session configuration, and here's how I sets my configuration:
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddDistributedMemoryCache();
services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromMinutes(300);//5 hours timeout timeTimeSpan.FromSeconds(10);
options.Cookie.HttpOnly = true;
options.Cookie.IsEssential = true;
});
services.AddAntiforgery(o => o.SuppressXFrameOptionsHeader = true);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
