I track links on my site and save it in a session, which will be used in some reports when they perform certain actions.
To get a referrer, I just do $_SESSION["s1"] = $_SERVER["HTTP_REFERER"];
$_SESSION["s1"] = $_SERVER["HTTP_REFERER"];
It seems to work for everything but YouTube. When you click on a YouTube link, an empty referrer is created. What could be the reason for this? Is YouTube going to do something in the headlines? Does referrer information open a new window?
Today I ran into this problem. Although this question is 5 years old, it first appeared on Google when I searched for a reason; so I'm going to answer it here for others who stumbled upon it.
YouTube, . referer, HTTPS HTTP. referer, URI, HTTPS .
referer