Cleanup session hook code