How to send data via HTTP Header?

goodmorningsky

Centurion
Joined
Aug 18, 2003
Messages
172
I want to send authentication info when redirecting to one page to the other page . Those pages are running on different Application.
Both application are Cookie less.
I don't want to pass via Query string, since user shouldn't see it.

So, I decided to pass via HTTP HEADER.

FROM WebApp1/Page1.aspx.

private void bt_Click(object sender, System.EventArgs e)
{
Response.AppendHeader("SkyHeader", "Sky header contents");
Response.Redirect("http://localhost/WebApp2/Page2.aspx");
}

AND FROM WebApp2/Page2.aspx
private void Page_Load(object sender, System.EventArgs e)
{
string myHeaderInfo = Request.Headers["SkyHeader"];
}

BUT, the problem is myHeaderInfo always null. There is no header named "SkyHeader".

WHAT is problem??
How can I send the info???
Any comment will help!!
Thank you.
 
When you do a Response.Redirect, the asp.net runtime sends the browser a HTTP 304. Your browser then creates a request to the url to redirect to via HTTP-GET !!!.

I'm sorry but you can't have it both ways..If you don't want to use cookies, encrypt the data and place it in the query.
 
Back
Top