getting Reffering site info

getting Reffering site info

am 23.07.2007 20:00:03 von TdarTdar

Hello,
I want to get reffering site info like if the way they got to the site is
from google, While that is easy enough, of course, but I want to get that
info after they have been on the site for a while, I was thinking that I
could get the reffer in the session_onstart event, and make it a session var
but that did not work, So I am looking for thoughts about this.

Tdar

Re: getting Reffering site info

am 23.07.2007 20:23:56 von exjxw.hannivoort

=?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
microsoft.public.inetserver.asp.general:

> Hello,
> I want to get reffering site info like if the way they got to the
> site is
> from google, While that is easy enough, of course, but I want to get
> that info after they have been on the site for a while, I was thinking
> that I could get the reffer in the session_onstart event, and make it
> a session var but that did not work, So I am looking for thoughts
> about this.

Referrer = Request.ServerVariables("HTTP_REFERER")

Why would you want he result in a session variable,
as the above is available all through the session?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: getting Reffering site info

am 23.07.2007 20:36:00 von TdarTdar

So HTTP_REFERER is only populated from the start and when they run thru
other pages of our site it aways stays the same data as the first time they
accesed the site?


"Evertjan." wrote:

> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
> microsoft.public.inetserver.asp.general:
>
> > Hello,
> > I want to get reffering site info like if the way they got to the
> > site is
> > from google, While that is easy enough, of course, but I want to get
> > that info after they have been on the site for a while, I was thinking
> > that I could get the reffer in the session_onstart event, and make it
> > a session var but that did not work, So I am looking for thoughts
> > about this.
>
> Referrer = Request.ServerVariables("HTTP_REFERER")
>
> Why would you want he result in a session variable,
> as the above is available all through the session?
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

Re: getting Reffering site info

am 23.07.2007 20:58:07 von exjxw.hannivoort

=?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
microsoft.public.inetserver.asp.general:

> "Evertjan." wrote:
>
>> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
>> microsoft.public.inetserver.asp.general:
>>
>> > Hello,
>> > I want to get reffering site info like if the way they got to the
>> > site is
>> > from google, While that is easy enough, of course, but I want to
>> > get that info after they have been on the site for a while, I was
>> > thinking that I could get the reffer in the session_onstart event,
>> > and make it a session var but that did not work, So I am looking
>> > for thoughts about this.
>>
>> Referrer = Request.ServerVariables("HTTP_REFERER")
>>
>> Why would you want he result in a session variable,
>> as the above is available all through the session?

[Please do not toppost on usenet]

> So HTTP_REFERER is only populated from the start and when they run
> thru other pages of our site it aways stays the same data as the first
> time they accesed the site?

You are right, my mistake.



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: getting Reffering site info

am 23.07.2007 22:02:02 von TdarTdar

So I still need a solve for this, :(

If it was possiable to get ServerVariables("HTTP_REFERER")
when the session is first opened, I should try a asp.net handler?
and get it before the page is write is that even possiable?





"Evertjan." wrote:

> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
> microsoft.public.inetserver.asp.general:
>
> > "Evertjan." wrote:
> >
> >> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
> >> microsoft.public.inetserver.asp.general:
> >>
> >> > Hello,
> >> > I want to get reffering site info like if the way they got to the
> >> > site is
> >> > from google, While that is easy enough, of course, but I want to
> >> > get that info after they have been on the site for a while, I was
> >> > thinking that I could get the reffer in the session_onstart event,
> >> > and make it a session var but that did not work, So I am looking
> >> > for thoughts about this.
> >>
> >> Referrer = Request.ServerVariables("HTTP_REFERER")
> >>
> >> Why would you want he result in a session variable,
> >> as the above is available all through the session?
>
> [Please do not toppost on usenet]
>
> > So HTTP_REFERER is only populated from the start and when they run
> > thru other pages of our site it aways stays the same data as the first
> > time they accesed the site?
>
> You are right, my mistake.
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

Re: getting Reffering site info

am 24.07.2007 00:23:38 von exjxw.hannivoort

=?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
microsoft.public.inetserver.asp.general:

> So I still need a solve for this, :(
>
> If it was possiable to get ServerVariables("HTTP_REFERER")
> when the session is first opened, I should try a asp.net handler?
> and get it before the page is write is that even possiable?

Sorry, I do not like topposting.


>
> "Evertjan." wrote:
>
>> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
>> microsoft.public.inetserver.asp.general:
>>
>> > "Evertjan." wrote:
>> >
>> >> =?Utf-8?B?VGRhclRkYXI=?= wrote on 23 jul 2007 in
>> >> microsoft.public.inetserver.asp.general:
>> >>
>> >> > Hello,
>> >> > I want to get reffering site info like if the way they got to
>> >> > the site is
>> >> > from google, While that is easy enough, of course, but I want to
>> >> > get that info after they have been on the site for a while, I
>> >> > was thinking that I could get the reffer in the session_onstart
>> >> > event, and make it a session var but that did not work, So I am
>> >> > looking for thoughts about this.
>> >>
>> >> Referrer = Request.ServerVariables("HTTP_REFERER")
>> >>
>> >> Why would you want he result in a session variable,
>> >> as the above is available all through the session?
>>
>> [Please do not toppost on usenet]
>>
>> > So HTTP_REFERER is only populated from the start and when they run
>> > thru other pages of our site it aways stays the same data as the
>> > first time they accesed the site?
>>
>> You are right, my mistake.



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: getting Reffering site info

am 24.07.2007 00:54:10 von reb01501

TdarTdar wrote:
> Hello,
> I want to get reffering site info like if the way they got to the
> site is from google, While that is easy enough, of course, but I want
> to get that info after they have been on the site for a while, I was
> thinking that I could get the reffer in the session_onstart event,
> and make it a session var but that did not work, So I am looking for
> thoughts about this.
>
Start by showing us the code you attempted to use and then move on to
telling us what "did not work" means.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: getting Reffering site info

am 26.07.2007 16:34:02 von TdarTdar

in global.asa and in global.asax

Sub Session_OnStart
Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
End Sub


When I run a test to see if it worked I get nothing
EX:

<%=Session("WhereFrom")%>








"Bob Barrows [MVP]" wrote:

> TdarTdar wrote:
> > Hello,
> > I want to get reffering site info like if the way they got to the
> > site is from google, While that is easy enough, of course, but I want
> > to get that info after they have been on the site for a while, I was
> > thinking that I could get the reffer in the session_onstart event,
> > and make it a session var but that did not work, So I am looking for
> > thoughts about this.
> >
> Start by showing us the code you attempted to use and then move on to
> telling us what "did not work" means.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: getting Reffering site info

am 26.07.2007 17:52:18 von reb01501

TdarTdar wrote:
> in global.asa and in global.asax
>
> Sub Session_OnStart
> Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
> End Sub
>
>
> When I run a test to see if it worked I get nothing
> EX:
>
> <%=Session("WhereFrom")%>
>
>
I see. yes, the code to assign the value for Session("WhereFrom") has to be
in a .asp page, not in global.asa. HTTP_REFERER will be empty in global.asa
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: getting Reffering site info

am 26.07.2007 18:26:01 von TdarTdar

Hi,
I was thinking the same thing untill i saw this article
http://msdn2.microsoft.com/en-us/library/ms953184.aspx
and this code from it

Sub Session_onStart()
On Error Resume Next
strSQL = "INSERT INTO Sessions " _
&
"(EventType,URL,Referer,RemoteHost,UserAgent,UALanguage,User ID,HostIP)" _
& " VALUES ('New Session', '" _
& Request.ServerVariables("URL") & "', '" _
& Request.ServerVariables("HTTP_REFERER") & "', '" _
& Request.ServerVariables("REMOTE_HOST") & "', '" _
& Request.ServerVariables("HTTP_USER_AGENT") & "', '" _
& Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "', " _
& CLng(Session.SessionID) & ", '" _
& Request.ServerVariables("LOCAL_ADDR") & "')"
WriteSessionData(strSQL)
End Sub

So I thought maybe that it was due to having the same session names in
global.asa as global.asax and that was not the case I still get nothing, of
course I can
get the http_REFERER. The article does say it if is not an asp page then it
will not work on htm pages, and the page is an asp page.

So I am kinda stumped why microsoft says it is possiable in there one article



"Bob Barrows [MVP]" wrote:

> TdarTdar wrote:
> > in global.asa and in global.asax
> >
> > Sub Session_OnStart
> > Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
> > End Sub
> >
> >
> > When I run a test to see if it worked I get nothing
> > EX:
> >
> > <%=Session("WhereFrom")%>
> >
> >
> I see. yes, the code to assign the value for Session("WhereFrom") has to be
> in a .asp page, not in global.asa. HTTP_REFERER will be empty in global.asa
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: getting Reffering site info

am 27.07.2007 00:10:27 von Anthony Jones

"Bob Barrows [MVP]" wrote in message
news:%23WZMpz5zHHA.4928@TK2MSFTNGP05.phx.gbl...
> TdarTdar wrote:
> > in global.asa and in global.asax
> >
> > Sub Session_OnStart
> > Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
> > End Sub
> >
> >
> > When I run a test to see if it worked I get nothing
> > EX:
> >
> > <%=Session("WhereFrom")%>
> >
> >
> I see. yes, the code to assign the value for Session("WhereFrom") has to
be
> in a .asp page, not in global.asa. HTTP_REFERER will be empty in
global.asa

I haven't tested it yet but I can't see why that should be so.
Session_OnStart does occur in the context of a HTTP request and all that a
ServerVariables("HTTP_XXXXX") does is access the request header called
XXXXX. ASP would have to go out of its way to block access to the Referer
for some reason for it not be able to read this header.

--
Anthony Jones - MVP ASP/ASP.NET

Re: getting Reffering site info

am 27.07.2007 00:12:14 von Anthony Jones

"TdarTdar" wrote in message
news:1F2B30B5-1447-481B-A5B1-14A6DAFBB732@microsoft.com...
> Hi,
> I was thinking the same thing untill i saw this article
> http://msdn2.microsoft.com/en-us/library/ms953184.aspx
> and this code from it
>
> Sub Session_onStart()
> On Error Resume Next
> strSQL = "INSERT INTO Sessions " _
> &
> "(EventType,URL,Referer,RemoteHost,UserAgent,UALanguage,User ID,HostIP)" _
> & " VALUES ('New Session', '" _
> & Request.ServerVariables("URL") & "', '" _
> & Request.ServerVariables("HTTP_REFERER") & "', '" _
> & Request.ServerVariables("REMOTE_HOST") & "', '" _
> & Request.ServerVariables("HTTP_USER_AGENT") & "', '" _
> & Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "', " _
> & CLng(Session.SessionID) & ", '" _
> & Request.ServerVariables("LOCAL_ADDR") & "')"
> WriteSessionData(strSQL)
> End Sub
>
> So I thought maybe that it was due to having the same session names in
> global.asa as global.asax and that was not the case I still get nothing,
of
> course I can
> get the http_REFERER. The article does say it if is not an asp page then
it
> will not work on htm pages, and the page is an asp page.
>
> So I am kinda stumped why microsoft says it is possiable in there one
article
>


Have you checked that a referer header is actually being sent by the
browser?
Use www.fiddlertool.com to watch what the browser is doing when you navigate
from one page into a page that starts the session.


--
Anthony Jones - MVP ASP/ASP.NET

Re: getting Reffering site info

am 27.07.2007 02:57:07 von reb01501

Anthony Jones wrote:
> "Bob Barrows [MVP]" wrote in message
> news:%23WZMpz5zHHA.4928@TK2MSFTNGP05.phx.gbl...
>> TdarTdar wrote:
>>> in global.asa and in global.asax
>>>
>>> Sub Session_OnStart
>>> Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
>>> End Sub
>>>
>>>
>>> When I run a test to see if it worked I get nothing
>>> EX:
>>>
>>> <%=Session("WhereFrom")%>
>>>
>>>
>> I see. yes, the code to assign the value for Session("WhereFrom")
>> has to be in a .asp page, not in global.asa. HTTP_REFERER will be
>> empty in global.asa
>
> I haven't tested it yet but I can't see why that should be so.
> Session_OnStart does occur in the context of a HTTP request and all
> that a ServerVariables("HTTP_XXXXX") does is access the request
> header called XXXXX. ASP would have to go out of its way to block
> access to the Referer for some reason for it not be able to read this
> header.

Now that i think about it, I'm not sure what I was thinking of. It would
still help to test it to verify it, but I can find nothing to say the
ServerVariables aren't available in global.asa.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: getting Reffering site info

am 27.07.2007 15:28:02 von TdarTdar

Anthony,
I have done a check but not with www.fiddlertool.com I do get a http_***
stuff in the browser when I test and loop thru them all from the page.
...

I may have a support incident avaiable so I guess I am going to have to go
that route.



"Bob Barrows [MVP]" wrote:

> Anthony Jones wrote:
> > "Bob Barrows [MVP]" wrote in message
> > news:%23WZMpz5zHHA.4928@TK2MSFTNGP05.phx.gbl...
> >> TdarTdar wrote:
> >>> in global.asa and in global.asax
> >>>
> >>> Sub Session_OnStart
> >>> Session("WhereFrom") = Request.ServerVariables("HTTP_REFERER")
> >>> End Sub
> >>>
> >>>
> >>> When I run a test to see if it worked I get nothing
> >>> EX:
> >>>
> >>> <%=Session("WhereFrom")%>
> >>>
> >>>
> >> I see. yes, the code to assign the value for Session("WhereFrom")
> >> has to be in a .asp page, not in global.asa. HTTP_REFERER will be
> >> empty in global.asa
> >
> > I haven't tested it yet but I can't see why that should be so.
> > Session_OnStart does occur in the context of a HTTP request and all
> > that a ServerVariables("HTTP_XXXXX") does is access the request
> > header called XXXXX. ASP would have to go out of its way to block
> > access to the Referer for some reason for it not be able to read this
> > header.
>
> Now that i think about it, I'm not sure what I was thinking of. It would
> still help to test it to verify it, but I can find nothing to say the
> ServerVariables aren't available in global.asa.
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: getting Reffering site info

am 27.07.2007 15:35:43 von Anthony Jones

"TdarTdar" wrote in message
news:5F16804E-3BA3-400A-BD92-3901DA5B7B74@microsoft.com...
> Anthony,
> I have done a check but not with www.fiddlertool.com I do get a http_***
> stuff in the browser when I test and loop thru them all from the page.
> ..
>

Do you get HTTP_REFERER header in your test? You are navigating to it from
another page that is outside your app? If you enter the URL in the address
bar or using a link from favorites or some such you're not going to get a
referer.


--
Anthony Jones - MVP ASP/ASP.NET

RE: getting Reffering site info

am 27.07.2007 16:02:04 von TdarTdar

ok I got is solve before i had to talk to microsoft,

if starting page is .asp then global.asa on start gets set

if starting page is .aspx then global.asax is used

session vars are nottransforable between the two without additional coding
and there is an acticle from microsoft on that
http://msdn2.microsoft.com/en-US/library/aa479313.aspx .

and you are out of luck with htm or html


"TdarTdar" wrote:

> Hello,
> I want to get reffering site info like if the way they got to the site is
> from google, While that is easy enough, of course, but I want to get that
> info after they have been on the site for a while, I was thinking that I
> could get the reffer in the session_onstart event, and make it a session var
> but that did not work, So I am looking for thoughts about this.
>
> Tdar

Re: getting Reffering site info

am 27.07.2007 17:02:21 von Anthony Jones

"TdarTdar" wrote in message
news:25A4781C-F8F1-43F7-9605-E0BCD2F74401@microsoft.com...
> ok I got is solve before i had to talk to microsoft,
>
> if starting page is .asp then global.asa on start gets set
>
> if starting page is .aspx then global.asax is used
>
> session vars are nottransforable between the two without additional coding
> and there is an acticle from microsoft on that
> http://msdn2.microsoft.com/en-US/library/aa479313.aspx .
>
> and you are out of luck with htm or html
>

Ouch. Sorry about that I had missed you stating earlier that you had the
session start code in both global.asa and .asax.

--
Anthony Jones - MVP ASP/ASP.NET