どのような状況でHttpContext.Current.Sessionがnullになる可能性がありますか?
いくつかのasp.netページがあります。
なぜSessionオブジェクトを常にnullと照合する必要があるのか疑問に思っていますか?
例えば
public static object GetSession(string key)
{
if (HttpContext.Current.Session != null)
{
return HttpContext.Current.Session[key];
}
return null;
}