Home > Net >  How do I create an auto timeout for users that redirect to login page?
How do I create an auto timeout for users that redirect to login page?

Time:02-10

I want to add a section to my site which will logout the user and redirect them to the log in page. I want to do this so no user is idle or keep one login secession open for more than 24 hours. How would I create an auto timeout in c#?

CodePudding user response:

Are you using Identity framework? If yes, you will find IdentityConfig.cs class in App_Start folder. In ApplicationUserManager add the following line of code or set the value as per your requirements.

manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(15);
  •  Tags:  
  • Related