Response cookie

I want to implement a cookie response with res.cookie("session", sessionCookie, options) inside function on http endpoint, but the response is

{
    "error": "uncaught promise rejection: TypeError: 'cookie' is not a function",
    "error_code": "UncaughtPromiseRejection",
    "link": "https://realm.mongodb.com/groups/61c5de338f9e565e72786fed/apps/61c5e1a50adfe0043973576f/logs?co_id=61f2594a1ff0abecfd731638"
}