I am trying out signalR and followed their Chat sample with a few modifications. So, in the ChatHub.cs, I tried to access the user's session variable and found out that I couldn't. So I've searched the web for answers and found this: Access to Session from a Hub
So as commented by Mr. David Fowl, accessing session variables through HttpContext.Current is bad. Is it really that bad that I should avoid using it? I really need to access the session variable.
I am guessing the reason it is bad is because your code will not work if hosted outside of the asp.net context. Since HttpContext.Current is web specific
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With