res.clearCookie(COOKIE_NAME) is not clearing the cookie in graphql-express-typescript

Viewed 118

I set cookie session but res.clearCookie() is not clearing it.

@Mutation(() => Boolean)
  logout(@Ctx() { req, res }: MyContext) {
    return new Promise((resolve) =>
      req.session.destroy((err) => {
        res.clearCookie('graphql');

        if (err) {
          console.log(err.message);
          resolve(false);
          return;
        }
        resolve(true);
      })
    );
  }
}

mutation is resolving true but "graphql" cookie is still on the browser. I lookup the for the similar issues and i added this

   res.clearCookie('graphql', { path: "/", domain: "localhost" });

but this did not help neither. enter image description here

0 Answers
Related