The UrlReferer is only valid or will have value when coming from or being "referred" by another page.
So if a visitor hits your site from a desktop shortcut, favorites item, or typing in the url in the address bar, or anything of that nature there will be no referer to track in session.
Now if you click on a link from another page ... then that page will become the referer page.
If you have issues with it throwing exceptions I stop it by having a global static class function in most apps to take care of it like this ....
public static String QString(String paramName)
{
String tmpS = String.Empty;
try
{
tmpS = HttpContext.Current.Request.ServerVariables[paramName].ToString();
}
catch
{
tmpS = String.Empty;
}
return tmpS;
}
Hope this helps ....