SharpDeveloper
How to get session or other custom values into ELMAH
In “Timing is Everything” I mentioned how I successfully managed to convince management to install ELMAH. I wanted to add some comments as to how to easily get some values into ELMAH that you might have in your SESSION.
The easy way, with no code changes, is simply store those values in a COOKIE.
HttpCookie c = new HttpCookie("CUSTOMVAL");
c.Value = (string) Session["CUSTOMVAL"];
Response.Cookies.Add(c);
Viola! It will be in the ELMAH Error page!
Related Reading:
Other Interesting Posts
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta







