久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Asp.net System.Web.HttpContext.Current.Session 在 global.asa

Asp.net System.Web.HttpContext.Current.Session null in global.asax(Asp.net System.Web.HttpContext.Current.Session 在 global.asax 中為 null)
本文介紹了Asp.net System.Web.HttpContext.Current.Session 在 global.asax 中為 null的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在 global.asax 中為當前線程設置了一個自定義安全主體對象,一切正常,通常沒有問題.

I have a custom security principal object which I set in the global.asax for the current thread and all is well, no problems normally.

但是,我只是通過讓頁面提供圖像來添加動態圖像功能,每當加載該動態圖像頁面時,System.Web.HttpContext.Current.Session 在 global.asax 中為 null,這會阻止我從那時起,將安全主體設置為正常和級聯問題.

However, I'm just adding a dynamic image feature by having a page serve up the image and whenever that dynamic image page is loaded the System.Web.HttpContext.Current.Session is null in global.asax which prevents me from setting the security principal as normal and cascading problems from that point onwards.

通常情況下,global.asax 中的 Session 僅在用戶登錄開始時的會話期間為空一次,之后它始終可用,但有這個例外.

Normally the Session is null in global.asax only once during a session at the start when the user logs in, afterwards it's always available with this single exception.

當瀏覽器遇到原始頁面中的圖像標簽時加載動態圖像頁面,即

The dynamic image page is loaded when the browser comes across an image tage in the original page i.e.

我猜這是瀏覽器請求該頁面而不發送一些憑據這一事實的某些方面?

I'm guessing that this is some aspect of the fact that the browser is requesting that page without sending some credentials with it?

任何幫助將不勝感激.

推薦答案

John,

我假設您正在為處理程序使用 ashx 處理程序.如果是這樣,請確保從 IRequiresSessionState 派生,例如:

I'm assuming you're using an ashx handler for the handler. If so, be sure to derive from IRequiresSessionState for example:

public class Images : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{ }

如果您不使用 ashx,您能描述一下動態圖像頁面的含義嗎?

If you're not using an ashx can you describe what you mean by dynamic image page?

喬希

這篇關于Asp.net System.Web.HttpContext.Current.Session 在 global.asax 中為 null的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應該總是在 C# 中使用可空類型)
C# HasValue vs !=null(C# HasValue vs !=null)
C# ADO.NET: nulls and DbNull -- is there more efficient syntax?(C# ADO.NET:空值和 DbNull —— 有沒有更高效的語法?)
How to set null value to int in c#?(如何在c#中將空值設置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調用)
主站蜘蛛池模板: 中文字幕视频在线看5 | 欧美国产日韩一区二区三区 | 久久精品国产免费一区二区三区 | 成人精品一区二区户外勾搭野战 | 国产精品日日摸夜夜添夜夜av | 精品欧美激情精品一区 | 99热播精品 | 欧美色综合 | 91精品久久久久久久久久入口 | www.国产视频| 精品成人一区二区 | 久久婷婷av | 在线播放91 | 精品一区视频 | 自拍偷拍亚洲欧美 | av天天操 | 成人午夜精品 | 欧美片网站免费 | 污片在线观看 | 欧美乱大交xxxxx另类电影 | 伊人久久在线 | 逼逼网| 日韩免费av一区二区 | 免费一区| www.伊人.com | 日本黄色激情视频 | 亚洲成人精品 | 亚洲精品乱码 | 国产区在线视频 | 久久国际精品 | 一级做a爰片久久毛片 | 2021狠狠天天天 | 成人av一区 | 三级av在线| 日韩精品一区二区三区免费视频 | 在线观看免费黄色片 | 秋霞电影院午夜伦 | 中文字幕精品视频在线观看 | 狠狠干美女| 成人a免费 | 国产区在线 |