I want to store the stack trace of exception in a cookie or in a session to email to the admin about the error through bug reporting system created separately.
I tried this but it do not store it
catch (Exception ex)
{
HttpCookie m = new HttpCookie("exe");
m.Values["e"] = ex.StackTrace.ToString();
Response.Cookies.Add(m);
Response.Redirect("~\\Error.aspx");
}