Repost: HTTP_REFERER not there when coming from an ASP Response.Redirect

D

Drebin

I posted this over at the ASP.NET group, but you guys are pretty sharp - is
this an obvious answer for anyone?? I'm really jammed up!!

---------------------------------------

I am retrofitting a central login application and want to be able to read
the Request.ServerVariables["HTTP_REFERER"] so that when they have logged
on, I can send them back to wherever they were trying to go..

If you try to load a legacy ASP app, I do this:

If Len(SessionID) <> 40 Then
Response.Redirect "/WAS/Default.aspx?AppCode=2400"
End If

On Default.aspx, I go so far as do this:

foreach (string s in Request.ServerVariables.AllKeys)
{
Response.Write(s + "=[" + Request.ServerVariables + "]<br>");
}

HTTP_REFERER is blank. If I had a <a href="Default.aspx">click</a> on that
same page, then referer fills in. Why can I not see the HTTP_REFERER in this
scenario??

Also, I tried instead of the Response.Redirect, doing something like:

<script>
window.location.href='/WAS/Default.asp?AppCode=2400';
</script>

Just in case Response.Redirect sends some wacky header that is throwing off
ASP.NET??

I'm really jammed up and running WAY behind - any insight greatly
appreciated, thanks!!
 
C

clintonG

I've tried -- twice -- to reply to the other newsgroup but for
some reasons my replies show in the OE Sent folder but do not
appear in the newsgroup.

What I'm trying to explain is that the only way to populate the
HTTP_REFERER variable with data is by a click event and even
when the variable is populated correctly there are several reasons
why the actual value may never be accessible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top