来自ASP Response.Redirect时不存在HTTP_REFERER [英] HTTP_REFERER not there when coming from an ASP Response.Redirect

查看:63
本文介绍了来自ASP Response.Redirect时不存在HTTP_REFERER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在改装一个中央登录应用程序,并希望能够读取请求。服务器变量[" HTTP_REFERER]的

,这样当他们记录了

on ,我可以把它们送回他们想去的地方..


如果你试图加载一个传统的ASP应用程序,我这样做:


如果Len(SessionID)<> 40然后

Response.Redirect" /WAS/Default.aspx?AppCode = 2400"

结束如果


默认值.aspx,我到目前为止:


foreach(在Request.ServerVariables.AllKeys中的字符串s)

{

Response.Write(s +" = [" + Request.ServerVariables [s] +"]< br>");

}


HTTP_REFERER为空。如果我有< a href =" Default.aspx">则点击< / a>在那个

相同的页面上,然后referer填写。为什么我在这个

场景中看不到HTTP_REFERER?


另外,我尝试了代替Response.Redirect,做了类似的事情:


< script>

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

< / script>


以防万一Response.Redirect发送一些丢弃的古怪标题

ASP.NET ??


我真的陷入困境并且在后面运行 - 任何洞察力都很大

赞赏,谢谢!!

解决方案

" Drebin" <第******* @ hotmail.com>在消息中写道

新闻:QF ******************* @ newssvr31.news.prodigy。 com ...

我正在改装中央登录应用程序,希望能够阅读Request.ServerVariables [" HTTP_REFERER"],以便在他们登录时
在,我可以把它们发回到他们试图去的任何地方..

如果你试图加载一个传统的ASP应用程序,我这样做:

如果Len(SessionID) )<> 40然后
Response.Redirect" /WAS/Default.aspx?AppCode = 2400"
结束如果

在Default.aspx上,我就这么做了:

foreach(Request.ServerVariables.AllKeys中的字符串s)
{
Response.Write(s +" = [" + Request.ServerVariables [s] +"] < br>");
}

HTTP_REFERER为空。如果我有< a href =" Default.aspx">则点击< / a>在那个
相同的页面上,然后引用填写。为什么我不能在这个
情景中看到HTTP_REFERER?

另外,我试过而不是响应.Redirect,做类似的事情:

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

以防万一Response.Redirect发送一些古怪的标题,即抛弃
ASP.NET?

我是非常紧张和运行方式 - 任何洞察力都非常赞赏,谢谢!!




推荐人标题并不保证在那里。你的代码必须是

能够处理这种情况。


-----

John Saunders


click事件返回的值是使用数据填充HTTP_REFERER变量的唯一方法。


-

<%= Clinton Gallagher,结果两倍 - 成本的一半

建筑与建筑电子商务咨询 - 软件开发

NET cs ********* @ REMOVETHISTEXTmetromilwaukee.com

URL http:// www.metromilwaukee.com/clintongallagher/

" John Saunders" <乔************** @ hotmail.com>在消息中写道

news:Ox **************** @ TK2MSFTNGP14.phx.gbl ...

" Drebin" ; <第******* @ hotmail.com>在消息中写道
新闻:QF ******************* @ newssvr31.news.prodigy。 com ...

我正在改装中央登录应用程序并希望能够阅读Request.ServerVariables [" HTTP_REFERER],以便在他们记录
时在,我可以把它们发回到他们试图去的任何地方..

如果你试图加载一个传统的ASP应用程序,我这样做:

如果Len(SessionID) )<> 40然后
Response.Redirect" /WAS/Default.aspx?AppCode = 2400"
结束如果

在Default.aspx上,我就这么做了:

foreach(Request.ServerVariables.AllKeys中的字符串s)
{
Response.Write(s +" = [" + Request.ServerVariables [s] +"] < br>");
}

HTTP_REFERER为空。如果我有< a href =" Default.aspx">则点击< / a>在
那个相同的页面上,然后referer填写。为什么我不能在
这个场景中看到HTTP_REFERER?

另外,我试过而不是响应.Redirect,做类似的事情:

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

以防万一Response.Redirect发送一些古怪的标题,即抛弃
ASP.NET?

我是真的陷入困境并且在后面运行 - 任何洞察力都非常赞赏,谢谢!
推荐人头部并不保证在那里。你的代码必须



能够处理这种情况。

-----
John Saunders



但我已经用传统的ASP来度过了这么多次。例如,如果

你导航到/ App1 /或/ App2 /或/ App3 / - 它们都会检查

是否存在cookie,如果是的话没有它重定向到/登录/ -

应用程序已经验证了你,它会从你那里发回给你!!


我明白那里是执行Forms

身份验证的独家.NET替代方案,但这些应用程序是传统的ASP。为什么这不再是
工作???????

" clintonG" < CS ********* @ REMOVETHISTEXTmetromilwaukee.com>在消息中写道

新闻:Oc ************** @ TK2MSFTNGP14.phx.gbl ...

由a返回的值click事件是用数据填充HTTP_REFERER变量的唯一方法。

<%= Clinton Gallagher,结果两倍 - 成本的一半
建筑与建筑电子商务咨询 - 软件开发
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

" John Saunders" <乔************** @ hotmail.com>在消息中写道
新闻:Ox **************** @ TK2MSFTNGP14.phx.gbl ...

" Drebin" <第******* @ hotmail.com>在消息中写道
新闻:QF ******************* @ newssvr31.news.prodigy。 com ...

>我正在改装中央登录应用程序并希望能够
>阅读
> Request.ServerVariables [" HTTP_REFERER"],以便在他们记录>时在,我可以把他们送回他们想去的地方..
>
>如果您尝试加载旧版ASP应用程序,我会这样做:
>
>如果Len(SessionID)<> 40然后
> Response.Redirect" /WAS/Default.aspx?AppCode = 2400"
>结束如果
>
>在Default.aspx上,我做到这一点:
>
> foreach(Request.ServerVariables.AllKeys中的字符串s)
> {
> Response.Write(s +" = [" + Request.ServerVariables [s] +"]< br>");
> }
>
> HTTP_REFERER为空。如果我有< a href =" Default.aspx">则点击< / a>在那>相同的页面,然后referer填写。为什么我不能在
>中看到HTTP_REFERER。这个
>情景??
>
>此外,我尝试了而不是Response.Redirect,做了类似的事情:
>
> < script>
> window.location.href =''/ WAS / Default.asp?AppCode = 2400'';
> < / script>
>
>以防万一Response.Redirect发送一些古怪的标题,它正在抛出
>关闭
> ASP.NET ??
>
>我真的陷入困境并且背后隐约可见 - 任何洞察力都很大
>赞赏,谢谢!!



推荐人头不保证在那里。您的代码必须


能够处理该案例。

-----
John Saunders




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[s] + "]<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!!

解决方案

"Drebin" <th*******@hotmail.com> wrote in message
news:QF*******************@newssvr31.news.prodigy. com...

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[s] + "]<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!!



The Referrer header isn''t guaranteed to be there. Your code will have to be
able to handle that case.

-----
John Saunders


A value returned by a click event is the only way to
populate the HTTP_REFERER variable with data.

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"John Saunders" <jo**************@hotmail.com> wrote in message
news:Ox****************@TK2MSFTNGP14.phx.gbl...

"Drebin" <th*******@hotmail.com> wrote in message
news:QF*******************@newssvr31.news.prodigy. com...

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[s] + "]<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!!
The Referrer header isn''t guaranteed to be there. Your code will have to


be able to handle that case.

-----
John Saunders



But I''ve used this zillions of times with traditional ASP. For example, if
you navigate to /App1/ or /App2/ or /App3/ - they all check for the
existence of a cookie, if it''s not there it redirects you to /Login/ - after
that app has authenticated you, it sends you back from whence you came!!

I understand there is the exclusively .NET alternative of doing Forms
authentication, but these apps are traditional ASP. Why does this no longer
work???????
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...

A value returned by a click event is the only way to
populate the HTTP_REFERER variable with data.

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"John Saunders" <jo**************@hotmail.com> wrote in message
news:Ox****************@TK2MSFTNGP14.phx.gbl...

"Drebin" <th*******@hotmail.com> wrote in message
news:QF*******************@newssvr31.news.prodigy. com...

>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[s] + "]<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!!



The Referrer header isn''t guaranteed to be there. Your code will have to


be

able to handle that case.

-----
John Saunders




这篇关于来自ASP Response.Redirect时不存在HTTP_REFERER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆