check CBIOCookie for NULL before trying to call it