Step 4: In code behind file, KillSession method will contain the Session.Abandon which will abandon the session.

KillSession method has to be signatured with WebMethod.

Make the KillSession method static[System.Web.Services.WebMethod()]publicstaticvoid KillSession()
{ HttpContext.Current.Session.Abandon();
}Step 5 : The code which needs to be executed on should be placed in Session_End method of Global.asax.csprotectedvoid Session_End(object sender, EventArgs e)
{
//Code to execute on Session End}