private _generateDeleteChunks()

in src/core/utils/cookie.ts [137:171]


  private _generateDeleteChunks(name: string, force: boolean /* add the delete cookie even if the corresponding cookie doesn't exist */) {
    const cookies: Record<string, CookieOptions> = {};

    // check for unchunked cookie
    if (force || this._existingCookies[name]) {
      cookies[name] = {
        name: name,
        value: "deleted",
        path: "/",
        httpOnly: false,
        expires: new Date(1).toUTCString(),
      };
    }

    // check for chunked cookie
    let found = true;
    let index = 0;

    while (found) {
      const chunkName = `${name}_${index}`;
      found = !!this._existingCookies[chunkName];
      if (found) {
        cookies[chunkName] = {
          name: chunkName,
          value: "deleted",
          path: "/",
          httpOnly: false,
          expires: new Date(1).toUTCString(),
        };
      }
      index += 1;
    }

    return cookies;
  }