ASP.NET一般处理程序和放大器;会议 [英] ASP.NET Generic Handlers & Session
问题描述
我有GenericHandler和anonymousIdentification的问题。
I have an issue with GenericHandler and anonymousIdentification.
基本上,如果< anonymousIdentification启用=真/>
在web配置开启,每当一个jQuery GET / POST请求被发送到服务器,该请求一个新用户和新用户会话下执行。
Basically if <anonymousIdentification enabled="true" />
is turned on in the web config, whenever a JQuery GET/POST request is sent to the server, that request executes under a new user and a new user session.
有没有办法来缓解呢?我需要访问当前用户的会话变量...这是很无奈!
Is there a way to mitigate this? I need to access the current user's session variables... It is really frustrating!
推荐答案
通用处理程序必须实现<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.sessionstate.ireadonlysessionstate.aspx\"><$c$c>IReadOnlySessionState$c$c>接口访问会话变量。如果您还需要编写会话变量,实施<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.sessionstate.irequiressessionstate.aspx\"><$c$c>IRequiresSessionState$c$c>.
Generic handlers must implement the IReadOnlySessionState
interface to access session variables. If you also need to write session variables, implement IRequiresSessionState
.
这篇关于ASP.NET一般处理程序和放大器;会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!