How can I signout FormAuthentication when browser or tab close?
using MVC 4 c#.
Printable View
How can I signout FormAuthentication when browser or tab close?
using MVC 4 c#.
You can try to use body.onblur event and do a location.href = '/account/logoff' (but it will not work 100%). Also you can specify a small timeout in your web.config (default is 30 minutes).
Code:<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="5"/>
</authentication>