Does static reference to HttpContext.Current.Session return same session for all users?

偶尔善良 提交于 2019-11-30 21:08:56

HttpContext.Current always returns the context of the current request (if there is a current request).

Since each user will be executing a different request, each context will be different.

toddmo

Your property is static. This is actually the cause of sharing the property between users.

See Scope of static Variable in multi-user ASP.NET web application for more details.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!