- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我们在使用自定义控件的 AuthenticateRequest 时遇到问题:对于持久化信息,我们使用HttpContext.Current.Application.
由于各种原因,如果多个用户同时工作,这将无法正常工作,因为应用程序 key 不是决定性的。
问题:持久化发生在 AuthenticateRequest 事件中,据我所知,在该事件中无法访问 Session。我搜索了一下,发现了 PostAuthenticateRequest 事件和关于差异的描述:http://leastprivilege.com/2006/07/02/authenticaterequest-vs-postauthenticaterequest/
可悲的是,我仍然无法访问 session ,HttpApplication 抛出错误:
{"Session state is not available in this context."}
并且 HttpApplication.Context.Session 一直为 NULL。
此时是否有可能获得 session ?或者我可以使用另一个事件来达到相同的目的吗?
提前致谢。
马蒂亚斯
Edith:我发现 Header 在 MapRequestHandler (Header set) 和 PostMapRequestHandler (Header not set) 之间丢失了
最佳答案
你的问题是PostAuthenticateRequest发生在管道的较早位置,即 AcquireRequestState 之前叫做。为了访问 session 状态,您需要执行该事件,并且应该查看生命周期后期的事件。如果您不熟悉事件序列,请查看 here ...
关于c# - AuthenticateRequest 与 PostAuthenticateRequest + session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23684144/
这是我的 Global.asax.cs 文件: public class MvcApplication : System.Web.HttpApplication { public static
我正在使用 global.asax 文件 (ASP.NET MVC) 中的 Application_PostAuthenticateRequest 方法实现自定义票证系统。我想知道这种事情的开销是多少
我有表单例份验证,我需要一个自定义对象存储在 HttpContext.Current.User 和 Thread.CurrentPrincipal 中。 为了得到这个,我听了 PostAuthenti
我们在使用自定义控件的 AuthenticateRequest 时遇到问题:对于持久化信息,我们使用HttpContext.Current.Application. 由于各种原因,如果多个用户同时工作
我正在尝试遵循 Brock Allen 的示例,了解如何使用声明将自定义角色添加到 Windows 角色。( http://brockallen.com/2013/01/17/adding-custo
如何使用 PostAuthenticateRequest Global.asax 事件?我关注 this tutorial它提到我必须使用 PostAuthenticateRequest 事件。当我添
我是一名优秀的程序员,十分优秀!