How to handle before user logs out?

in erpnext how can i determine user logout behavior because i want to delete some things before user logout?