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!