Use auth.logout instead of flushing session

This means that the response redirects to login immeadiately rather than on the next request,