tags:

views:

121

answers:

1

How do I time out the session a ASP.NET MVC logged in user after about 5 mins or so forcing him to have to login in order to continue?

+2  A: 

Since MVC is just like WebForms in that they both run on ASP.NET and assuming you're using Forms Authentication you can either:

  • Force the user to logout with FormsAuthenitcation.SignOut() which will clear their authentication cookie; or

  • Set the forms authentication timeout value (default is 30 minutes). For example:

<system.web>
  <authentication mode="Forms">
    <forms timeout="5"/>
  </authentication>
</system.web>
BFOT
Forms authentication and session are two separate things, although I think for what the question is asking, this will suffice.
womp