updated to reuse OptionalCookie and change withCookie to withCookies