html5 - websocket如何带上cookie?
天蓬老师
天蓬老师 2017-04-17 13:03:00
0
2
1168

websocket如何带上cookie?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
PHPzhong

HTTP is a stateless connection and only needs cookies to record the status
And websocket always maintains a connection, so there is no need for cookies. When you need to share the login information of the previous system, just send the cookie directly.
What you need should be an authentication mechanism. This mechanism can be compatible with the cookie implementation just mentioned,
or use Basic Auth, OAuth 2 or the like

巴扎黑

websocket is a link to the TCP/IP layer, and cookies are things of the application layer HTTP protocol, so they cannot.
Unless websocket the downgrade solution is used when the browser does not support it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template