问题
While creating WebSocket on client side, browser also sends cookies with Headers. Is there are a way to disable this behavior.
I read WebSocket documentation on Mozilla Dev Net (https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) but couldn't find any documentation regrading this.
回答1:
No, there is no way to do that.
Cookies won't be send if the websocket server is in another domain. Or if they are in another subdomain but the cookie is not allowed in subdomains.
How do browser cookie domains work?
来源:https://stackoverflow.com/questions/27983153/how-to-disable-cookies-in-header-while-creating-websocket