。是否有成员可以像FormsAuthentication.FormsCookieName一样轻松访问此名称">
ASP.NET中会话Id的默认cookie名称为ASP.NET_SessionId
。也可以将此名称更改为其他名称,如<sessionState cookieName="FooBar" />
。
是否有成员可以像FormsAuthentication.FormsCookieName
一样轻松访问此名称
发布于 2010-09-17 22:47:52
考虑到您说您在web.config上为cookie设置了不同的名称,那么我会说您可以从那里读取cookie名称
SessionStateSection sessionStateSection =
(System.Web.Configuration.SessionStateSection)
ConfigurationManager.GetSection("system.web/sessionState");
string cookieName = sessionStateSection.CookieName;
https://stackoverflow.com/questions/3739537
复制