Remove HttpOnly cookie using serverless

Has anyone here tried removing a HttpOnly cookie using the serverless “Set-Cookie” following this documentation?

Below is a sendResponse in my serverless.

sendResponse({ body: {message: Cookie ${cookieName} deleted successfully}, "Set-Cookie": ${cookieName}=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain=.hs-sites.com; httpOnly=true;secure, statusCode: 200 });

Hi, @CBelga :waving_hand: Thank you for the interesting question!

I’d like to invite some of our community members to the conversation. Hey, @Teun @louischausse @Kevin-C @DHolland @stefen, do you have any recent experience you can share with @CBelga?

Thank you for taking a look! — Jaycee

I’ve developed a private, password-protected webpage on HubSpot. When a user enters the correct password, a cookie named “_key” followed by random numbers (e.g. 124794456884_key) is generated. If this cookie is manually deleted, the user is prompted to re-enter the password upon revisiting the page. I want to enable the manual deletion of this cookie when the user clicks a logout button or link. However, the cookie is HttpOnly, meaning it can only be removed server-side. I attempted to use a serverless function and “Set-Cookie”, but it was unsuccessful.