It could be achived with help of Session state management
<configuration>
<system.web>
<sessionstate mode="InProc" timeout="20" regenerateexpiredsessionid="true" />
</system.web>
</configuration>
then if in your web app exists Global.asax , in taht module
declare method
void Session_End(object sender, EventArgs e)
{
}