How to disable cookies in Header while creating websocket?

大憨熊 提交于 2021-02-10 22:50:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!