The cookie remains with its previous value. After some testing it turns out that Firefox is getting annoyed with the "path" attribute. Removing that makes the cookie go away properly.
It's apparently more complicated. The path attribute is okay, as long as it is the same as the path used when setting the cookie (or subset?).
Confirmed that this is still an issue with Firefox 112. Fortunately, we also remove the cookie via the response to the WebSocket request, which is sufficient to get rid of it even on Firefox (although see bug 8190).