I have a project that I created with
asp.net core.
In this project,
HttpContext.SignInAsync(),
I import my user. My problem is that the timeout I gave to delete the cookie in local works properly, but when it starts working on the server, it sends login again within 5 minutes when I do not take action. When I spoke to the hosting bought server authorities, IIS applications were allowed 5 minutes and if no action was taken, the server would go to sleep. I keep going back to login. How can I extend this period or help if I keep sending requests so that the server does not shut down?
You need ideas or information to solve this problem. They didn't do a try
Login service
claims.Add(new Claim(ClaimTypes.NameIdentifier, result.Id.ToString()));
var claimsIdentity = new ClaimsIdentity(
claims, CookieAuthenticationDefaults.AuthenticationScheme);
var authProperties = new AuthenticationProperties
{
IsPersistent = /*dto.RememberMe*/ true,
};
await HttpContext.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
new ClaimsPrincipal(claimsIdentity),
authProperties);
return role;
}
Startup.cs
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(opt => {
opt.Cookie.Name = "";
opt.ExpireTimeSpan = TimeSpan.FromSeconds(99999);
opt.Cookie.IsEssential = true;
opt.ReturnUrlParameter = "/Account/SignIn";
opt.LogoutPath = "/Account/SignIn";
opt.LoginPath = "/Account/SignIn";
opt.AccessDeniedPath= "/Account/SignIn";
});