I have created BlazorWebAssembly Project in RadzenBlazorStudio and Used AspNetCore.Identity Security. But the problem is, the cookie expires after 30 minutes, even if the expiration time fixed at 8 Hours.
The Changes Made are,
In Program.cs
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie();
builder.Services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "MyCookie";
options.ExpireTimeSpan = new TimeSpan(8, 0, 0);
options.SlidingExpiration = false;
});
In AccountController
AuthenticationProperties authProperties = new AuthenticationProperties
{
IsPersistent = true,
ExpiresUtc = DateTime.UtcNow.AddDays(30),
};
await signInManager.SignInWithClaimsAsync( ApplicationUser, authProperties, claims);
The Current UTC: 7/12/2023 8:23:28 AM
And the Cookie Set Expires/Max-Age To: 2023-08-11T08:23:15.572Z
But Expires after 30 Minutes.