Session Expire

Folk,

Blazor server side

I need the system to log users out after say 30mins of no activity. Does anyone know how i can make this happen?

Thanks

John

Hi @johnmu,

You can try this StackOverflow answer. You will need to create a partial class for your Startup as described in the Custom Startup section of our article.

Atanas,

I have tried this

public partial class Startup
{
    partial void OnConfigureServices(IServiceCollection services)
    {
        services.ConfigureApplicationCookie(options =>
        {
            options.ExpireTimeSpan = TimeSpan.FromMinutes(1);
        });
    }



}

}

the OnConfigure method won't compile, probably because i don't know what directive to add.

Any thoughts?

thanks John

What are the compilation errors? Usually some namespace is not imported.

this is what happens when i copy the OnConfigure method intot the class

Indeed the actual signature of the method should be

partial void OnConfigure(IApplicationBuilder app, IWebHostEnvironment env)
{
}

I will update the documentation.