Hello,

I have the below requirement.

When ever my website is opened by any link: say clicked from the google
search result or a link from other website:

Then I should able to know the referrer URL. How Do I get that?

I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
"global.asa" file in "Session_OnStart" event like this:

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

Sub Session_OnEnd
Session("ReferralURL") = ""
End Sub

So that I can use the session variable any where in my website, because the
HTTP_REFERER will give the URL of the last webpage.

But this seems to not working.

Please help.

Thanks
Prabhat

Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 05:48:49 CDT 2005

Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:

> Hello,
>
> I have the below requirement.
>
> When ever my website is opened by any link: say clicked from the
> google search result or a link from other website:
>
> Then I should able to know the referrer URL. How Do I get that?
>
> I know about Request.ServerVariables("HTTP_REFERER"). So I used this
> in "global.asa" file in "Session_OnStart" event like this:
>
> Sub Session_OnStart
> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> End Sub

Seting a session variable here will not work, IMHO.

> Sub Session_OnEnd
> Session("ReferralURL") = ""
> End Sub

Clearing a session variable here has no effect, since all session
variables die with the end of a session anyway.

> So that I can use the session variable any where in my website,
> because the HTTP_REFERER will give the URL of the last webpage.

No, in your case it would [but doesn't] give only the URL of referral
site when opening the session.

Better put this file as an include
<!--#include virtual ="/test/myInclude.asp"-->
on all your pages:

/test/myInclude.asp:
<%
if Session("started") = "" then
Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
Session("started") = "yes!"
end if
%>


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Thu Sep 01 06:54:07 CDT 2005

Hi Evertjan, Thanks for reply.

You mean to say if I put the Session("ReferralURL") =
Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will not work.
I have also tested that and it is not working. Can you please explain why?
Because as per my knowledge the Session_OnStart event will start for each
session.

As per your suggestion I will create one .asp file with the sample code and
include the file in all pages.

Can you suggest an easy method so that I need not to modify all the pages to
include the new file?

I think your logic says that if the Session Variable "started" is empty then
only assign the Session Variable with the Referral URL else no.

But dont you think I should also crear these variables on Session_OnEnd
event? Please suggest.

Thanks
Prabhat


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns96C4825B2A79Aeejj99@194.109.133.242...
> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
>
> > Hello,
> >
> > I have the below requirement.
> >
> > When ever my website is opened by any link: say clicked from the
> > google search result or a link from other website:
> >
> > Then I should able to know the referrer URL. How Do I get that?
> >
> > I know about Request.ServerVariables("HTTP_REFERER"). So I used this
> > in "global.asa" file in "Session_OnStart" event like this:
> >
> > Sub Session_OnStart
> > Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> > End Sub
>
> Seting a session variable here will not work, IMHO.
>
> > Sub Session_OnEnd
> > Session("ReferralURL") = ""
> > End Sub
>
> Clearing a session variable here has no effect, since all session
> variables die with the end of a session anyway.
>
> > So that I can use the session variable any where in my website,
> > because the HTTP_REFERER will give the URL of the last webpage.
>
> No, in your case it would [but doesn't] give only the URL of referral
> site when opening the session.
>
> Better put this file as an include
> <!--#include virtual ="/test/myInclude.asp"-->
> on all your pages:
>
> /test/myInclude.asp:
> <%
> if Session("started") = "" then
> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> Session("started") = "yes!"
> end if
> %>
>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 08:27:28 CDT 2005

Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
>> Prabhat wrote on 01 sep 2005 in
>> > I know about Request.ServerVariables("HTTP_REFERER"). So I used
>> > this in "global.asa" file in "Session_OnStart" event like this:
>> >
>> > Sub Session_OnStart
>> > Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>> > End Sub
>>
>> Seting a session variable here will not work, IMHO.
>>
>> > Sub Session_OnEnd
>> > Session("ReferralURL") = ""
>> > End Sub
>>
>> Clearing a session variable here has no effect, since all session
>> variables die with the end of a session anyway.
>>
>> > So that I can use the session variable any where in my website,
>> > because the HTTP_REFERER will give the URL of the last webpage.
>>
>> No, in your case it would [but doesn't] give only the URL of referral
>> site when opening the session.
>>
>> Better put this file as an include
>> <!--#include virtual ="/test/myInclude.asp"-->
>> on all your pages:
>>
>> /test/myInclude.asp:
>> <%
>> if Session("started") = "" then
>> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>> Session("started") = "yes!"
>> end if
>> %>

[please do not toppost on usenet]

> You mean to say if I put the Session("ReferralURL") =
> Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will not
> work. I have also tested that and it is not working. Can you please
> explain why? Because as per my knowledge the Session_OnStart event
> will start for each session.

It is als per specification. Only certein objects are available
in global.asa, I think

> As per your suggestion I will create one .asp file with the sample
> code and include the file in all pages.
>
> Can you suggest an easy method so that I need not to modify all the
> pages to include the new file?

No. Unless you mean local programming in C++ or VB etc..

> I think your logic says that if the Session Variable "started" is
> empty then only assign the Session Variable with the Referral URL else
> no.

Otherwise Session("ReferralURL") would be filled with each referring
local page.

> But dont you think I should also crear these variables on
> Session_OnEnd event? Please suggest.

As I said, no.

1 Session variables without sessions are deleted automaticly.

2 Session_OnEnd firing is unrelyable.

3 Sessions do not end, when the user "leaves" [sloppy defined] the site,
but only when the session times out or with commands like session.abandon
or with the server closing down/restarting.


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Thu Sep 01 09:49:32 CDT 2005


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns96C49D40FEA05eejj99@194.109.133.242...
> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
> > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> >> Prabhat wrote on 01 sep 2005 in
> >> > I know about Request.ServerVariables("HTTP_REFERER"). So I used
> >> > this in "global.asa" file in "Session_OnStart" event like this:
> >> >
> >> > Sub Session_OnStart
> >> > Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> >> > End Sub
> >>
> >> Seting a session variable here will not work, IMHO.
> >>
> >> > Sub Session_OnEnd
> >> > Session("ReferralURL") = ""
> >> > End Sub
> >>
> >> Clearing a session variable here has no effect, since all session
> >> variables die with the end of a session anyway.
> >>
> >> > So that I can use the session variable any where in my website,
> >> > because the HTTP_REFERER will give the URL of the last webpage.
> >>
> >> No, in your case it would [but doesn't] give only the URL of referral
> >> site when opening the session.
> >>
> >> Better put this file as an include
> >> <!--#include virtual ="/test/myInclude.asp"-->
> >> on all your pages:
> >>
> >> /test/myInclude.asp:
> >> <%
> >> if Session("started") = "" then
> >> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> >> Session("started") = "yes!"
> >> end if
> >> %>
>
> [please do not toppost on usenet]
>
> > You mean to say if I put the Session("ReferralURL") =
> > Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will not
> > work. I have also tested that and it is not working. Can you please
> > explain why? Because as per my knowledge the Session_OnStart event
> > will start for each session.
>
> It is als per specification. Only certein objects are available
> in global.asa, I think
>
> > As per your suggestion I will create one .asp file with the sample
> > code and include the file in all pages.
> >
> > Can you suggest an easy method so that I need not to modify all the
> > pages to include the new file?
>
> No. Unless you mean local programming in C++ or VB etc..
>
> > I think your logic says that if the Session Variable "started" is
> > empty then only assign the Session Variable with the Referral URL else
> > no.
>
> Otherwise Session("ReferralURL") would be filled with each referring
> local page.
>
> > But dont you think I should also crear these variables on
> > Session_OnEnd event? Please suggest.
>
> As I said, no.
>
> 1 Session variables without sessions are deleted automaticly.
>
> 2 Session_OnEnd firing is unrelyable.
>
> 3 Sessions do not end, when the user "leaves" [sloppy defined] the site,
> but only when the session times out or with commands like session.abandon
> or with the server closing down/restarting.
>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>

Hi Evertjan,

Thanks for the reply. Now I understodd the concept. Thanks for the post.

Prabaht



Re: Use of HTTP_REFERER in Global.asa by Aaron

Aaron
Thu Sep 01 10:12:52 CDT 2005

Does anybody see what's wrong with bottom-posting here? Just curious if
it's only me that is irritated to scroll through 90 lines of re-hashed
garbage to see "thank you."





"Prabhat" <not_a_mail@hotmail.com> wrote in message
news:Om1zbOwrFHA.1032@TK2MSFTNGP12.phx.gbl...
>
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns96C49D40FEA05eejj99@194.109.133.242...
>> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
>> > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
>> >> Prabhat wrote on 01 sep 2005 in

...
>> >> > this in "global.asa" file in "Session_OnStart" event like this:
>> >> >
>> >> > Sub Session_OnStart
>> >> > Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>> >> > End Sub
>> >>
>> >> Seting a session variable here will not work, IMHO.
>> >>
>> >> > Sub Session_OnEnd
>> >> > Session("ReferralURL") = ""
>> >> > End Sub
>> >>
>> >> Clearing a session variable here has no effect, since all session
>> >> variables die with the end of a session anyway.
>> >>
>> >> > So that I can use the session variable any where in my website,
>> >> > because the HTTP_REFERER will give the URL of the last webpage.
>> >>
>> >> No, in your case it would [but doesn't] give only the URL of referral
>> >> site when opening the session.
>> >>
>> >> Better put this file as an include
>> >> <!--#include virtual ="/test/myInclude.asp"-->
>> >> on all your pages:
>> >>
>> >> /test/myInclude.asp:
>> >> <%
>> >> if Session("started") = "" then
>> >> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>> >> Session("started") = "yes!"
>> >> end if
>> >> %>
>>
>> [please do not toppost on usenet]
>>
>> > You mean to say if I put the Session("ReferralURL") =
>> > Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will not
>> > work. I have also tested that and it is not working. Can you please
>> > explain why? Because as per my knowledge the Session_OnStart event
>> > will start for each session.
>>
>> It is als per specification. Only certein objects are available
>> in global.asa, I think
>>
>> > As per your suggestion I will create one .asp file with the sample
>> > code and include the file in all pages.
>> >
>> > Can you suggest an easy method so that I need not to modify all the
>> > pages to include the new file?
>>
>> No. Unless you mean local programming in C++ or VB etc..
>>
>> > I think your logic says that if the Session Variable "started" is
>> > empty then only assign the Session Variable with the Referral URL else
>> > no.
>>
>> Otherwise Session("ReferralURL") would be filled with each referring
>> local page.
>>
>> > But dont you think I should also crear these variables on
>> > Session_OnEnd event? Please suggest.
>>
>> As I said, no.
>>
>> 1 Session variables without sessions are deleted automaticly.
>>
>> 2 Session_OnEnd firing is unrelyable.
>>
>> 3 Sessions do not end, when the user "leaves" [sloppy defined] the site,
>> but only when the session times out or with commands like session.abandon
>> or with the server closing down/restarting.
>>
>>
>> --
>> Evertjan.
>> The Netherlands.
>> (Replace all crosses with dots in my emailaddress)
>>
>
> Hi Evertjan,
>
> Thanks for the reply. Now I understodd the concept. Thanks for the post.
>
> Prabaht
>
>



Re: Use of HTTP_REFERER in Global.asa by Dave

Dave
Thu Sep 01 10:18:47 CDT 2005

Evertjan. wrote:
>> You mean to say if I put the Session("ReferralURL") =
>> Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will
>> not work. I have also tested that and it is not working. Can you
>> please explain why? Because as per my knowledge the Session_OnStart
>> event will start for each session.
>
> It is als per specification. Only certein objects are available
> in global.asa, I think

This would appear to contradict that claim:

"All the built-in objects (Application Object, ObjectContext
Object, Request Object, Response Object, Server Object, and
Session Object) are available and can be referenced in the
Session_OnStart event script."

http://msdn.microsoft.com/library/en-us/iissdk/html/3b6d0cc8-361e-418b-99e0-b0f289198c16.asp



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 10:24:21 CDT 2005

Aaron Bertrand [SQL Server MVP] wrote on 01 sep 2005 in
microsoft.public.inetserver.asp.general:
> Does anybody see what's wrong with bottom-posting here? Just curious if
> it's only me that is irritated to scroll through 90 lines of re-hashed
> garbage to see "thank you."
>

Bottom-posting is not the alternative of top-posting, Aaron.
Re-posting garbage is always a bad habit.
Sparse inter-posting is the best.
Top-posting should be discouraged at all times on usenet.

I am sorry that you ar so easily irritated,
and thereby forgetting what 30 years of
usenet experience brought us:
Netiquette.



--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Bob

Bob
Thu Sep 01 10:23:29 CDT 2005

Nah, it's lack of snipping, not where the reply was put.

Aaron Bertrand [SQL Server MVP] wrote:
> Does anybody see what's wrong with bottom-posting here? Just curious
> if it's only me that is irritated to scroll through 90 lines of
> re-hashed garbage to see "thank you."
>
>

--
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: Use of HTTP_REFERER in Global.asa by Danny

Danny
Thu Sep 01 10:29:04 CDT 2005

"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:utje7dwrFHA.3060@TK2MSFTNGP09.phx.gbl...
> "Prabhat" <not_a_mail@hotmail.com> wrote in message
> news:Om1zbOwrFHA.1032@TK2MSFTNGP12.phx.gbl...
>>
>> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
>> news:Xns96C49D40FEA05eejj99@194.109.133.242...
>>> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
>>> > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
>>> >> Prabhat wrote on 01 sep 2005 in
>
> ...
>>> >> > this in "global.asa" file in "Session_OnStart" event like this:
>>> >> >
>>> >> > Sub Session_OnStart
>>> >> > Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>>> >> > End Sub
>>> >>
>>> >> Seting a session variable here will not work, IMHO.
>>> >>
>>> >> > Sub Session_OnEnd
>>> >> > Session("ReferralURL") = ""
>>> >> > End Sub
>>> >>
>>> >> Clearing a session variable here has no effect, since all session
>>> >> variables die with the end of a session anyway.
>>> >>
>>> >> > So that I can use the session variable any where in my website,
>>> >> > because the HTTP_REFERER will give the URL of the last webpage.
>>> >>
>>> >> No, in your case it would [but doesn't] give only the URL of referral
>>> >> site when opening the session.
>>> >>
>>> >> Better put this file as an include
>>> >> <!--#include virtual ="/test/myInclude.asp"-->
>>> >> on all your pages:
>>> >>
>>> >> /test/myInclude.asp:
>>> >> <%
>>> >> if Session("started") = "" then
>>> >> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
>>> >> Session("started") = "yes!"
>>> >> end if
>>> >> %>
>>>
>>> [please do not toppost on usenet]
>>>
>>> > You mean to say if I put the Session("ReferralURL") =
>>> > Request.ServerVariables("HTTP_REFERER") in Session_OnStart it will not
>>> > work. I have also tested that and it is not working. Can you please
>>> > explain why? Because as per my knowledge the Session_OnStart event
>>> > will start for each session.
>>>
>>> It is als per specification. Only certein objects are available
>>> in global.asa, I think
>>>
>>> > As per your suggestion I will create one .asp file with the sample
>>> > code and include the file in all pages.
>>> >
>>> > Can you suggest an easy method so that I need not to modify all the
>>> > pages to include the new file?
>>>
>>> No. Unless you mean local programming in C++ or VB etc..
>>>
>>> > I think your logic says that if the Session Variable "started" is
>>> > empty then only assign the Session Variable with the Referral URL else
>>> > no.
>>>
>>> Otherwise Session("ReferralURL") would be filled with each referring
>>> local page.
>>>
>>> > But dont you think I should also crear these variables on
>>> > Session_OnEnd event? Please suggest.
>>>
>>> As I said, no.
>>>
>>> 1 Session variables without sessions are deleted automaticly.
>>>
>>> 2 Session_OnEnd firing is unrelyable.
>>>
>>> 3 Sessions do not end, when the user "leaves" [sloppy defined] the site,
>>> but only when the session times out or with commands like
>>> session.abandon
>>> or with the server closing down/restarting.
>>>
>>
>> Hi Evertjan,
>>
>> Thanks for the reply. Now I understodd the concept. Thanks for the post.
>
> [repositioned from top-posted reply]
> Does anybody see what's wrong with bottom-posting here? Just curious if
> it's only me that is irritated to scroll through 90 lines of re-hashed
> garbage to see "thank you."

Nowhere near as irritating as someone who breaks the flow of a thread.



Re: Use of HTTP_REFERER in Global.asa by McKirahan

McKirahan
Thu Sep 01 10:29:17 CDT 2005

"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:utje7dwrFHA.3060@TK2MSFTNGP09.phx.gbl...
> Does anybody see what's wrong with bottom-posting here? Just curious if
> it's only me that is irritated to scroll through 90 lines of re-hashed
> garbage to see "thank you."

[snip]


Why should I not top-post?
http://www.html-faq.com/etiquette/?toppost

"One reason why top-posting is so disliked is that those who do it very
rarely bother to snip any of the preceding post(s) - they leave masses of
quoted text trailing underneath their (frequently very brief) reply."


Usenet Basics
http://mugsy.org/asa_faq/getting_along/usenet.shtml

2. Replying and Quoting

There are many arguments about how to reply to a post on Usenet. There are
standard conventions and on a.s.a we have our preferred styles, briefly
described below.

a. Should I leave in the post I'm replying to, or delete it?

Snip (delete) the parts of a post you're not responding to directly, but
leave in some parts so people know what you're referring to.



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 10:29:30 CDT 2005

Dave Anderson wrote on 01 sep 2005 in
microsoft.public.inetserver.asp.general:

> Evertjan. wrote:
>> It is als per specification. Only certein objects are available
>> in global.asa, I think
>
> This would appear to contradict that claim:
>
> "All the built-in objects (Application Object, ObjectContext
> Object, Request Object, Response Object, Server Object, and
> Session Object) are available and can be referenced in the
> Session_OnStart event script."
>
> http://msdn.microsoft.com/library/en-us/iissdk/html/3b6d0cc8-361e-418b-
> 99e0-b0f289198c16.asp

Thank you, Dave.

I thought I had heard otherwise, but clearly I am wrong.

What do you think could be Prabhat's problem then?


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Aaron

Aaron
Thu Sep 01 10:38:55 CDT 2005

> Bottom-posting is not the alternative of top-posting, Aaron.
> Re-posting garbage is always a bad habit.

You did it in this very thread.

> Top-posting should be discouraged at all times on usenet.

WHY? Because you say so? Because one guy somewhere stated that he doesn't
like it? Blow it out your shorts.

> I am sorry that you ar so easily irritated,

No, I was just showing an example where your constant "do not top-post on
usenet" leads to an even less desirable behavior.

> and thereby forgetting what 30 years of
> usenet experience brought us:
> Netiquette.

So sorry grand master, you know all and I am an idiot. Bottom-post away.



Re: Use of HTTP_REFERER in Global.asa by Aaron

Aaron
Thu Sep 01 10:43:54 CDT 2005

Evertjan gets bent out of shape every time anyone top-posts. I do sometimes
because it's easy, and sometimes because it puts the most relevant content
"above the fold" -- e.g. less scrolling and scanning. More often, I
intersperse my comments where they're relevant, unless I'm only responding
to a single segment of the previous post (such as this example).

AFAIC, neither is a should or shouldn't thing, it is a personal preference.
Unlike Evertjan, I don't attack people who do one or the other and try to
coerce them to my point of view, and try to say that my view and
interpretation of netiquette is superior to all others. In this case, I was
highlighting it because it was a very good example of what bottom-posting
naturally leads to -- scrolling to the bottom of a 90-line message and
adding a one-liner at the end.







> Nah, it's lack of snipping, not where the reply was put.



Re: Use of HTTP_REFERER in Global.asa by Aaron

Aaron
Thu Sep 01 10:46:04 CDT 2005

This is ridiculous. I don't see how this is any more likely with
top-posting than bottom-posting. This thread should serve as a prime
example of where it can happen just as easily with bottom-posting.

Evertjan has attacked me in the past for top-posting and I can not remember
any situation where it had anything to do with me carelessly leaving useless
garbage in my reply.




> "One reason why top-posting is so disliked is that those who do it very
> rarely bother to snip any of the preceding post(s) - they leave masses of
> quoted text trailing underneath their (frequently very brief) reply."



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 10:54:42 CDT 2005

Aaron Bertrand [SQL Server MVP] wrote on 01 sep 2005 in
microsoft.public.inetserver.asp.general:

>> Bottom-posting is not the alternative of top-posting, Aaron.
>> Re-posting garbage is always a bad habit.
>
> You did it in this very thread.

What is garbage and what is not is in the eye of the beholder. ;-)

>> Top-posting should be discouraged at all times on usenet.
>
> WHY? Because you say so? Because one guy somewhere stated that he
> doesn't like it? Blow it out your shorts.

Why so aggressive, Aaron?

Again and again in the years I tell my meaning about preferred behavour
on usenet. I know you think differently. So be it. That does not mean I
should not tell others.

>> I am sorry that you ar so easily irritated,
>
> No, I was just showing an example where your constant "do not top-post
> on usenet" leads to an even less desirable behavior.

>> Aaron:
>>> it's only me that is irritated

See, you came up with the the word "irritated"!

>> and thereby forgetting what 30 years of
>> usenet experience brought us:
>> Netiquette.
>
> So sorry grand master, you know all and I am an idiot. Bottom-post
> away.

Thank you, Aaron, if you say so.

However, I did not advocate bottom-posting,
I politely asked not to top-post.
I don't think you are an idiot,
I think you are one of the mainstays of this NG.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 11:14:53 CDT 2005

Aaron Bertrand [SQL Server MVP] wrote on 01 sep 2005 in
microsoft.public.inetserver.asp.general:
> Evertjan has attacked me in the past for top-posting and I can not
> remember any situation where it had anything to do with me carelessly
> leaving useless garbage in my reply.

See, still you are irritated, Aaron.

Please don't be.

As far as I can remember,
I never attacked anyone,
unless you call a polite

"[please do not toppost on usenet]"

an attack.


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Thu Sep 01 11:31:20 CDT 2005

> This would appear to contradict that claim:
>
> "All the built-in objects (Application Object, ObjectContext
> Object, Request Object, Response Object, Server Object, and
> Session Object) are available and can be referenced in the
> Session_OnStart event script."
>
>
http://msdn.microsoft.com/library/en-us/iissdk/html/3b6d0cc8-361e-418b-99e0-
b0f289198c16.asp
>
Hi Dave,

Can you please lookinto my problem in the 1st post in this thread. Can you
please put some light on that or can you suggest me how can i do that?

Thanks
Prabhat



Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Thu Sep 01 11:33:56 CDT 2005

> Thank you, Dave.
>
> I thought I had heard otherwise, but clearly I am wrong.
>
> What do you think could be Prabhat's problem then?

Hi,

can you now suggest any thing?

Thanks
Prabhat



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Thu Sep 01 11:33:45 CDT 2005

Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:

>> Thank you, Dave.
>>
>> I thought I had heard otherwise, but clearly I am wrong.
>>
>> What do you think could be Prabhat's problem then?
>
> Hi,
>
> can you now suggest any thing?

Yes, testing!

Set a session variable with global.asa onstart,
and try to tead it on a page.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Aaron

Aaron
Thu Sep 01 11:50:52 CDT 2005

HTTP_REFERER is not always available (see http://www.aspfaq.com/2169). This
is, however, not one of those cases. This technique worked fine for me, as
long as the click actualy started a new session. I just did this on my own
box, with an HTML file I called from http://localhost/file.htm, with a link
to http://my_machine_name/file.asp, where global.asa in the root set a
session variable just like you do below, and file.asp outputs the session
variable. Worked flawlessly, as long as I started from scratch (e.g. closed
the browser).

If you are on your site, and then go to Google, and click on a link that
takes you to your site, session_onstart() won't fire because you still have
the old session.

Don't try to set the string to an empty string in session_onEnd. There is
no point. If session_onEnd is actually being called, then your variables
are blown away for you. But more often than not, it will not be called
(see http://www.aspfaq.com/2078).

My guess is that session variables are not working
(http://www.aspfaq.com/2157) or global.asa is not being called at all (see
http://www.aspfaq.com/2076). To isolate the problem, create a global.asa
that sets a session variable (just a constant/string, not based on
servervariables) in session_onstart. Open a new browser window, navigate to
a page that sets a different session variable, then navigate to a third page
that displays them both.







> Then I should able to know the referrer URL. How Do I get that?
>
> I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
> "global.asa" file in "Session_OnStart" event like this:
>
> Sub Session_OnStart
> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> End Sub




Re: Use of HTTP_REFERER in Global.asa by Dave

Dave
Fri Sep 02 08:23:44 CDT 2005

Evertjan. wrote:
> Thank you, Dave.
>
> I thought I had heard otherwise, but clearly I am wrong.
>
> What do you think could be Prabhat's problem then?

Probably a lack of understanding of either (a) when a session starts, or (b)
when the HTTP_REFERER header is sent.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.



Re: Use of HTTP_REFERER in Global.asa by Dave

Dave
Fri Sep 02 10:59:14 CDT 2005

I wrote:
>> What do you think could be Prabhat's problem then?
>
> Probably a lack of understanding of either (a) when a session
> starts, or (b) when the HTTP_REFERER header is sent.

Aaron was probably right on when he suggested global.asa was not firing at
all. This would be true if the OP failed to set up the folder as an
Application, and would fall under (a) above.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.



Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Mon Sep 26 08:52:41 CDT 2005

> Set a session variable with global.asa onstart,
> and try to tead it on a page.
>


Hi did you get any thing to help me? Prabhat



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Mon Sep 26 10:55:57 CDT 2005

Prabhat wrote on 26 sep 2005 in microsoft.public.inetserver.asp.general:

>> Set a session variable with global.asa onstart,
>> and try to tead it on a page.
>>
>
>
> Hi did you get any thing to help me? Prabhat
>
>

Who are you talking to?

Please try to quote correctly, with "xxx wrote on yyy:".

This thread has been dead for 25 days.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Mon Sep 26 11:10:59 CDT 2005

> Who are you talking to?
>
> Please try to quote correctly, with "xxx wrote on yyy:".
>
> This thread has been dead for 25 days.
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)

Hi Evertjan,

It was for you.

Prabhat



Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Mon Sep 26 11:15:26 CDT 2005

Hi,

["Evertjan" wrote on 01-Sep-2005]

> Yes, testing!
>
> Set a session variable with global.asa onstart,
> and try to tead it on a page.
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)

Hi Evertjan,

Did you get any thing to help me?

Thanks
Prabhat



Re: Use of HTTP_REFERER in Global.asa by Evertjan

Evertjan
Mon Sep 26 11:51:20 CDT 2005

Prabhat wrote on 26 sep 2005 in microsoft.public.inetserver.asp.general:

> Hi,
>
> ["Evertjan" wrote on 01-Sep-2005]
>
>> Yes, testing!
>>
>> Set a session variable with global.asa onstart,
>> and try to tead it on a page.
>>
>> --
>> Evertjan.
>> The Netherlands.
>> (Replace all crosses with dots in my emailaddress)
>
> Hi Evertjan,
>
> Did you get any thing to help me?

sorry, no.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Use of HTTP_REFERER in Global.asa by Prabhat

Prabhat
Tue Sep 27 02:20:51 CDT 2005

> When ever my website is opened by any link: say clicked from the google
> search result or a link from other website:
>
> Then I should able to know the referrer URL. How Do I get that?
>
> I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
> "global.asa" file in "Session_OnStart" event like this:
>
> Sub Session_OnStart
> Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
> End Sub
>
> Sub Session_OnEnd
> Session("ReferralURL") = ""
> End Sub
>
> So that I can use the session variable any where in my website, because
the
> HTTP_REFERER will give the URL of the last webpage.
>
> But this seems to not working.
>
> Please help.
>
> Thanks
> Prabhat
>


Hi All,

I know it is a very old post, But today I got some of the link in google
that I am trying.

Links: http://www.asp101.com/articles/jason/comefrom/default.asp

and
http://www.codehound.com/groups/thread.asp?t=1,187,1,3_9foutf$cq4@dispatch.c
oncentric.net_187

Thanks
Prabhat