SignalR 客户端是否为每个集线器请求发送身份验证 cookie

Does SignalR client send the authentication cookie for each hub request

我正在使用 signalr core 并且希望通过移动设备频繁地与客户端发送和接收消息,所以我一直在削减脂肪以最小化我的消息大小。我一直很好奇的一件事是,当从需要身份验证的集线器发出请求时,发送到集线器的每个请求是否也会发送它的 asp.net 核心身份验证 cookie,或者客户端是否只发送一次 cookie他们启动与集线器的连接,然后所有后续请求不再需要 cookie?

does every request sent to the hub also sends it's asp.net core authentication cookie, or does the client only send the cookie once when they initiate their connection to the hub and then all subsequent requests no longer need a cookie?

cookie 将与用于在客户端和服务器之间建立连接的 POST [endpoint-base]/negotiate 请求一起发送,如下所示。

如果建立连接并使用 WebSockets 传输,则服务器和客户端之间的消息交换将基于 WebSockets 协议。

如果 WebSockets 不可用,并且使用 Long Polling 传输,当客户端与集线器通信时,每个请求都会发送 cookie。

此外,如this doc所述:不推荐使用cookie认证,除非应用只需要从浏览器客户端认证用户。