SignalR difference between Context.Request.Cookies and Context.RequestCookies

StackOverflow https://stackoverflow.com/questions/22862235

  •  27-06-2023
  •  | 
  •  

سؤال

Is there any difference between Context.Request.Cookies and Context.RequestCookies? Both properties seem to have identical values. It is confusing.

هل كانت مفيدة؟

المحلول

It's exactly the same. The following is the implementation of the RequestCookies property of Microsoft.AspNet.SignalR.Hubs.HubCallerContext class:

public IDictionary<string, Cookie> RequestCookies
{
    get
    {
        return this.Request.Cookies;
    }
}

You can validate that by decompiling the Microsoft.AspNet.SignalR.Core.dll.

Actually, since this is open-source, you don't need to decompile, the code can be downloaded from GitHub: https://github.com/SignalR/SignalR/blob/master/src/Microsoft.AspNet.SignalR.Core/Hubs/HubCallerContext.cs

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top