ASP.NET中会话ID的默认cookie名称为 ASP.NET_SessionId . 也可以将此名称改为其他类似的名称 <sessionState cookieName="FooBar" /> .
ASP.NET_SessionId
<sessionState cookieName="FooBar" />
有没有一个成员可以像访问 FormsAuthentication.FormsCookieName ?
FormsAuthentication.FormsCookieName
考虑到你说你在web.config上为cookie设置了一个不同的名称,那么我想你可以从那里读取cookie的名称。
SessionStateSection sessionStateSection = (System.Web.Configuration.SessionStateSection) ConfigurationManager.GetSection("system.web/sessionState"); string cookieName = sessionStateSection.CookieName;