我添加了cookie密钥,而新的cookie密钥没有发送到服务器。 当我控制document.cookie时,我看到了新的价值。但是在请求中没有看到它,
客户端代码(有角度):
$cookies.InternalToken = credentials.token;
_connectionHub
.start();
集线器代码(.net c#):
var connection = new HubConnection(url);
connection.CookieContainer = new System.Net.CookieContainer();
connection.CookieContainer.Add(new System.Net.Cookie() { Name = "InternalToken", Value = "" });
答案 0 :(得分:0)
尝试为Cookie设置域名
connection.CookieContainer.Add(new System.Net.Cookie("InternalToken", "<value>") { Domain = new Uri(<"Host" of destination URL>);
EDIT
我假设您已检查集线器是否收到cookie