Logoff User when browser tab page is closed, ASP.NET MVC

Posted by Gopinath on Stack Overflow See other posts from Stack Overflow or by Gopinath
Published on 2009-09-02T10:04:59Z Indexed on 2010/05/31 11:03 UTC
Read the original article Hit count: 315

Filed under:
|

In one of the ASP.NET MVC apps we would like to logoff the user automatically if he closes the browser tab in which the app is opened.

We are using the following code when he authenticates.

FormsAuthentication.SetAuthCookie(userName, false)

As of now, if we closes the browser window and relaunch it, users are asked to authenticate again. But we want to ask users to authenticate again if they close the tab and try to access any of the website urls.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc