Skip to main content
Version: 2.2.x

Cookie management

Setting cookies

socket.setCookie({
name: string;
value: string;
domain?: string | undefined;
expires?: Date | undefined;
httpOnly?: boolean | undefined;
maxAge?: number | undefined;
partitioned?: boolean | undefined;
path?: string | undefined;
priority?: "low" | "medium" | "high" | undefined;
sameSite?: true | false | "lax" | "strict" | "none" | undefined;
secure?: boolean | undefined;
});

Removing cookies

socket.removeCookie(cookieName: string);

Be aware that cookies added by other scripts on the clientside only'll be synced to the server if syncCookies is called