Create a procedure and call them in a trigger during login and logout