Using a filter to catch login and logouts in client side