I have written a project with ASP.NET Core. When I publish the project to the server, my user can not log in for more than 30 minutes, and after 30 minutes, it needs to be re-authenticated and redirected to the login page.
This is my code in the ConfigureServices
method:
services.ConfigureApplicationCookie(options =>
{
options.Cookie.HttpOnly = false;
options.LoginPath = "/Login";
options.AccessDeniedPath = "/NotFound";
options.ExpireTimeSpan = TimeSpan.FromDays(30);
options.LogoutPath = "/SignOut";
});
And this is in the Configure
method:
app.UseAuthentication();
app.UseAuthorization();
This problem only occurs when the project is published