SignalR doesn't use Session on server

后端 未结 3 1090
青春惊慌失措
青春惊慌失措 2020-12-01 15:30

When I try to access the HttpContext current session from the HUB it returns null.

I tried making use of the interface IRequiresSessi

3条回答
  •  时光取名叫无心
    2020-12-01 16:22

    you can simply maintain your own session, for example, use in memory cache, http is stateless,so server need session to maintain clients,but web socket is keep-alive connection, server keeps connected with clients, by default no need such things like HttpContext Session.

提交回复
热议问题