Can Some one suggest the best way to do the forms authentication in my asp.net mvc application. My requirement is, if user is idle for 5 mins application should automatically redirect to login page. What is the best approach?
1 Answers
0
votes
Update your web.config as follows:
<system.web>
<authentication mode="Forms">
<forms name="AppName.Auth" loginUrl="~/Account/Login" protection="All" timeout="300" path="/" slidingExpiration="true" />
</authentication>
</system.web>
timeout="300" -> 5 minutes x 60 seconds
All the MVC actions decorated with [Authorize] attribute will redirect the user to login page after 5 mins of inactivity.