Solved

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

Posted on 2009-04-10
10
314 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your 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 500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

776 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