Question: I have an asp.net web page that has a 60 second idle-time window before the session will expire. Is there a way (either through asp, or c# code behind) to close the **browser** - or preferably just the tab - **in the Session\_End event?**

I've seen a lot of posts on SO that want to do the opposite (end the session on browser close), but not what I need.

Answer: 
You can't close the browser but you can redirect to a "Session Expired" page by doing this:

```
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        this.PageHead.Controls.Add(new LiteralControl(
            string.Format("<meta http-equiv='refresh' content='{0};url={1}'>", 
            Session.Timeout * 60, "SessionExpired.aspx")));
    }

```
You can look at this example - [Alert Session Time out in ASP.NET](http://www.codeproject.com/Articles/227382/Alert-Session-Time-out-in-ASP-Net)

It basically warn the user before timeout (For example, Bank Of America site). Once it reaches the time limit, redirect user to a logout page. 

FYI: User will get mad if you redirect or close a page without warning.