Reputation: 65
I have an issue with production env (shared hosting): it keeps logging me out after 30 seconds, but on the development machine it works fine. I'm using identity SignInManager
.
I've tried the following as suggested on github:
services.Configure<SecurityStampValidatorOptions>(options => options.ValidationInterval = TimeSpan.FromSeconds(10));
services.AddAuthentication()
.Services.ConfigureApplicationCookie(options =>
{
options.SlidingExpiration = true;
options.ExpireTimeSpan = TimeSpan.FromMinutes(30);
});
Upvotes: 2
Views: 671
Reputation: 2800
Inside your Startup.cs file add the following:
ConfigureServices(IServiceCollection services)
{
//your code here
services.AddDataProtection()
.SetApplicationName("your-app-name")
.PersistKeysToFileSystem(new DirectoryInfo("your-path-here"));
//your code here
}
You can check the details here.
Upvotes: 0
Reputation: 65
Apparently this was a memory issue. I've spoke with the hosting provider. The application pool memory was under 256MB.
Upvotes: 1