I have a page. There are some session variables those are used in a specified page only. How to clear those session variables when user left the page.
When user left the page using the menu/URL.
I have tried with
protected void Page_Unload(object sender, EventArgs e)
{
Session["Rules"] = null;
Session.Remove("Rules");
}
But it is now working :(
Please suggest.