473,471 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting Reffering site info

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
Jul 23 '07 #1
16 1867
=?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)
Jul 23 '07 #2
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)
Jul 23 '07 #3
=?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)
Jul 23 '07 #4
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)
Jul 23 '07 #5
=?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)
Jul 23 '07 #6
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"
Jul 23 '07 #7
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:
<body>
<%=Session("WhereFrom")%>
</body>



"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"
Jul 26 '07 #8
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:
<body>
<%=Session("WhereFrom")%>
</body>
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"
Jul 26 '07 #9
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,UALan guage,UserID,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:
<body>
<%=Session("WhereFrom")%>
</body>
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"
Jul 26 '07 #10
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@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:
<body>
<%=Session("WhereFrom")%>
</body>
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
Jul 26 '07 #11
"TdarTdar" <Td******@discussions.microsoft.comwrote in message
news:1F**********************************@microsof t.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,UALan guage,UserID,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
Jul 26 '07 #12
Anthony Jones wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@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:
<body>
<%=Session("WhereFrom")%>
</body>
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"
Jul 27 '07 #13
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]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@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:
<body>
<%=Session("WhereFrom")%>
</body>

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"
Jul 27 '07 #14
"TdarTdar" <Td******@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.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

Jul 27 '07 #15
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
Jul 27 '07 #16
"TdarTdar" <Td******@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.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
Jul 27 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Drifter | last post by:
Using HTTP_REFERER I cannot capture the URL when the link is made via a button: <input type="button" name="Continue" value="Continue Shopping"...
0
by: Jim | last post by:
I need some help getting started with a .NET web project for a commercial site. I am new to .NET and my understanding of some (but not all) of its concepts is a little sparse. I apologize for the...
0
by: Jim | last post by:
This si a repost, I apologize but perhaps my original inquiry got buried under all the usenet spam... I need some help getting started with a .NET web project for a commercial site. I am new to...
2
by: Bill S. | last post by:
Hey, I am trying to figure this out. The hyperlinks on my page open up a small popup window. I have no reason to refresh the parent page or what have you. I was living in a very happy world,...
10
by: darrel | last post by:
I have this structure: mypage.aspx (class = mypage) myusercontro.ascx On the mypage.aspx I can declare a variable: animal = "monkey" I can read this from the UC by simply doing this:...
3
by: Michael | last post by:
I have been doing PHP for over a year now but when I came round to writing a script I discovered that there was a reasonably sizeable gap in my knowledge that I didn't even know where to start...
0
by: Steve | last post by:
Hi All, I have a Python script that uses SOAPpy and I'm outputting all of the methods and info about the parameters... I'm having trouble getting information out of the __init__ parameter. ...
4
by: Max | last post by:
Hello, I live in Canada and I would like to get a copy of Visual Studio .NET 2005. I looked on Amazon and they don't ship to here and neither does Microsoft. I can't find any retailer that has VS...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.