0

I've a method which logs user activities in the database, I need to capture the logout activity but in our website there's no logout functionality so i want to trigger this user activity method when the session timeout occurs or when the browser is closed. I've tried calling this method from Session end method, but it dint work

Hema Sreya
  • 11
  • 1
  • 3

1 Answers1

1

you can handle on Session_End in Global.asax file

protected void Session_End(Object sender, EventArgs e)
{
    // Remove user from HashTable
}

this method only call when Session Is get Timeout

only way to track the browser closing is Js and for this purpose This link should help you

Nima Talebi
  • 797
  • 1
  • 7
  • 21