Skip to content

Instantly share code, notes, and snippets.

@tekiegirl
Created October 28, 2013 17:26
Show Gist options
  • Save tekiegirl/7200972 to your computer and use it in GitHub Desktop.
Save tekiegirl/7200972 to your computer and use it in GitHub Desktop.
Progromatically get SessionId Cookie name used in an asp.net application
using System.Configuration;
using System.Web.Configuration;
internal string GetSessionIdCookieName()
{
SessionStateSection sessionStateSection = (SessionStateSection)ConfigurationManager
.GetSection("system.web/sessionState");
return sessionStateSection != null ? sessionStateSection.CookieName : null;
}
<sessionState cookieName="FooBar" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment