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");
                }

Handle the global Application_error event (global.asax)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.