Thanks. I located the problem. The issue was with the site being in frames, and the code to grab the info, was in a framed page, thus I was getting the site as a refered since the main frame page was calling the sub html/cgi. Putting a SSI call to a cgi script to get the info works fine.
Any chance someone knows how i can set a new var to the browser so that all page calls will have the info, without using a dummy form?