?
Solved

How do I determine where a response.redirect came from?

Posted on 2009-04-10
10
Medium Priority
?
319 Views
Last Modified: 2012-05-06
I have a web site that I use to redirect a member to another website via https.  Because I use a response.redirect there is no HTTP_Referer available for the receiving site to validate that the reqeust came from my site.  Have tried to add a Resposne.AppendHeader prior to the response.redirect with no joy.  What can I do to ensure the request came from my site?
if (ConfigurationManager.AppSettings["Mask"].ToString().ToLower() == "true")
                {
                sbURL.Append(encryptQueryString(_EDIPI));
                Response.AppendHeader ("ReserveHeader","navyreserve.navy.mil");
                Response.Redirect(sbURL.ToString());
                }
                else
                {
                sbURL.Append(_EDIPI);
                Response.AppendHeader("ReserveHeader", "navyreserve.navy.mil");
                Response.Redirect(sbURL.ToString());
                }

Open in new window

0
Comment
Question by:mbart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24125088
> What can I do to ensure the request came from my site?
add a query parameter to all of your links
0
 

Author Comment

by:mbart
ID: 24126508
Is this the same as the querystring?  I pass an encrypted id via a querystring, but the receiving site wants to be sure it came from my site and not just a cut and paste of the url.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24131282
> .. ^wants to be sure it came from my site and not just a cut and paste of the url.
Could you explain how a link "comes from your site" differs from copying the same link in the URL bar?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:mbart
ID: 24133028
When a hyperlink is clicked the HTTP_Referer reflects the URL of the requesting (referring) site.  When it  is a cut and past there is no HTPP_Referer. This is what is the crux of my problem as I don't want to use a link, as I want to use a popup window and not show the query string if at all possible.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24145627
> When it  is a cut and past there is no HTPP_Referer.
and if the link was c&p and the referer added manually (proxy or whatever), how would you distinguish that?
The referer header is 101% unreliable.
0
 

Author Comment

by:mbart
ID: 24210786
I am well aware that the Http_referer is not reliable, but the question remains, is it possible to tell if the request came from my site vice someother place?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24223499
> .. is it possible ..
if you mean "reliable" when writing "possible", then the answer is no
otherwise the answer is sometimes yes by checking the Referer header
0
 

Author Comment

by:mbart
ID: 24224681
If no link is used ie; the request is generated from code, see code provided,  there is no Referer header which is why the question was posted in the beginning.  I have tried doing a add.header but that doesn't work as it doesn't show on my fully patched web front end.  Beginning to think there is no solution for this.  I am currently using a query string but that is not very reliable either.  Just looking for a way to determine the url the request is coming from.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 24224827
there're infinite tools which can perform a request, and most of them can use whaterver you like (and even what you cannot imagine:) as referer
So there is no reliable way to "determine the url the request is coming from".
0
 

Author Closing Comment

by:mbart
ID: 31568945
Thanks I will see what I can find, everything I have found so far says that a Microsoft patch has plugged the use of added headers.  But I will limp along with what I have.
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
What You Need to Know when Searching for a Webhost Provider
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question