I need to keep aurhorized user in the Blazor Server app as long as it possible so I put folowing code in the Program.cs
builder.Services.ConfigureApplicationCookie(config =>
{
config.Cookie.Name = ".MyApp.Session";
config.SlidingExpiration = true;
config.ExpireTimeSpan = TimeSpan.FromDays(360);
config.Cookie.HttpOnly = true;
});
builder.Services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromDays(360);
options.Cookie.IsEssential = true;
options.Cookie.HttpOnly = true;
});
So I expect that after login the HTML inside <Authorized>
tag will be visible as it described here.
<AuthorizeView>
<Authorized>
… Some HTML
</Authorized>
</AuthorizeView>
But after 20 minutes everything inside <Authorized>
tag is disappearing.
Anyway after I press F5 in the web browser it appears again and as I see that user is still logged on and authorized. Hmmm...
Please help me to keep UI of the authorized user visible. Thanks!