Star79
asked on
Code snippet to write the httpresponse and httprequest object to a text file
I need to troubleshoot a issue with session getting abandoned. In the following c# code, I need to write a the detailed httprequest and httpresponse in a text file to analyze further. One of the reason why I want to do this is to identify from which procedure the request was made which is causing the session to abandon. Sample code is given below. Any help will be highly appreciated.
void Application_PostRequestHan dlerExecut e(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
HttpRequest req = app.Request;
HttpResponse resp = app.Response;
///Code to capture the httprequest and httpresponse.
if (!ValidateRequest(req, resp))
{
FormsAuthentication.SignOu t();
Session.Abandon();
resp.Redirect(loginVPath, true);
}
}
}
void Application_PostRequestHan
{
HttpApplication app = (HttpApplication)sender;
HttpRequest req = app.Request;
HttpResponse resp = app.Response;
///Code to capture the httprequest and httpresponse.
if (!ValidateRequest(req, resp))
{
FormsAuthentication.SignOu
Session.Abandon();
resp.Redirect(loginVPath, true);
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.