What you are looking for is called ASP.NET Expressions . AppSettings , ConnectionStrings and Resources are the default providers available through ASP.NET, but you can write your own ASP.NET Expressions provider for just about anything.
The ones you are looking for (Cookies and Session) have been written and are available here .
source share