Solved

Can you explain how redirect to localhost works?

Posted on 2007-11-20
4
967 Views
Last Modified: 2008-02-01
In an application developed in asp.net 1.1 with c# I implemented a change to incorporate 3-D Secure for credit card payments. This involves redirecting customers to another site to validate their card and then the customer is redirected back to our site. When redirecting a dynamically generated page containing hidden values, including a return url, is posted to the other site. I using string redirecturl = Request.Urlreferrer.AbsoluteUrl + "?Redirect=y" to set up the return url. What I have found and didn't expect is that even when I run a local copy of the application it still returns back.
0
Comment
Question by:JamesJMcDonnell
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:john_steed
Comment Utility
Hey,

The redirect to localhost only works on computers that have the website installed on their localhost. You're code however should be correct, since when you move to a production environment, the return url will be correct

Hope this helps
0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
Just checking: So if the site is being developed on a pc's c: drive with a virtual directory in iis, then that means the site is installed on the pc ? and also another site is able to redirect back to the application running locally on that pc?  But how can their be a unique IP address, is this not needed?
0
 
LVL 3

Accepted Solution

by:
john_steed earned 500 total points
Comment Utility
http://localhost always refers to your own computer. Other sites can redirect back to it, but only when YOU open those sites in your browser.
It won't work if someone else gets redirected to localhost (because it will search for a site on his PC)
0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
Thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now