Request.UrlReferrer is NULL for HTTPS

2019-04-08 03:14发布

问题:

I am using "Request.UrlReferrer.AbsoluteUri" in my project to get the URL where my application is hosted. I am able to get the URL, if I am redirected from "http" host, but I am getting null, if I am redirected from "https" host. how can I get "UrlReferrer AbsoluteUri" of both "http and https"?

回答1:

Check the actual http data using a https-aware inspector like fiddler. Many browsers simply don't send the referrer when communicating over https, in which case there is simply no way to get it.

If you own the origin site, you could add something into the query-string as a substitute, but that's about it.