Use of HTTP_REFERER in Global.asa

Discussion in 'ASP General' started by Prabhat, Sep 1, 2005.

  1. Prabhat

    Prabhat Guest

    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
    Prabhat, Sep 1, 2005
    #1
    1. Advertising

  2. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #2
    1. Advertising

  3. Prabhat

    Prabhat Guest

    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." <> 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)
    >
    Prabhat, Sep 1, 2005
    #3
  4. Prabhat

    Evertjan. Guest

    Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
    > "Evertjan." <> 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)
    Evertjan., Sep 1, 2005
    #4
  5. Prabhat

    Prabhat Guest

    "Evertjan." <> wrote in message
    news:Xns96C49D40FEA05eejj99@194.109.133.242...
    > Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
    > > "Evertjan." <> 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
    Prabhat, Sep 1, 2005
    #5
  6. 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" <> wrote in message
    news:...
    >
    > "Evertjan." <> wrote in message
    > news:Xns96C49D40FEA05eejj99@194.109.133.242...
    >> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
    >> > "Evertjan." <> 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
    >
    >
    Aaron Bertrand [SQL Server MVP], Sep 1, 2005
    #6
  7. 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"
    Bob Barrows [MVP], Sep 1, 2005
    #7
  8. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #8
  9. Prabhat

    Danny@Kendal Guest

    "Aaron Bertrand [SQL Server MVP]" <> wrote in message
    news:...
    > "Prabhat" <> wrote in message
    > news:...
    >>
    >> "Evertjan." <> wrote in message
    >> news:Xns96C49D40FEA05eejj99@194.109.133.242...
    >>> Prabhat wrote on 01 sep 2005 in microsoft.public.inetserver.asp.general:
    >>> > "Evertjan." <> 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.
    Danny@Kendal, Sep 1, 2005
    #9
  10. Prabhat

    McKirahan Guest

    "Aaron Bertrand [SQL Server MVP]" <> wrote in message
    news:...
    > 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.
    McKirahan, Sep 1, 2005
    #10
  11. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #11
  12. > 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.
    Aaron Bertrand [SQL Server MVP], Sep 1, 2005
    #12
  13. 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.
    Aaron Bertrand [SQL Server MVP], Sep 1, 2005
    #13
  14. 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."
    Aaron Bertrand [SQL Server MVP], Sep 1, 2005
    #14
  15. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #15
  16. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #16
  17. Prabhat

    Prabhat Guest

    > 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
    Prabhat, Sep 1, 2005
    #17
  18. Prabhat

    Evertjan. Guest

    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)
    Evertjan., Sep 1, 2005
    #18
  19. Prabhat

    Prabhat Guest

    > 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
    Prabhat, Sep 1, 2005
    #19
  20. 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
    Aaron Bertrand [SQL Server MVP], Sep 1, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darlene Gauthier

    PostRequestHandlerExecute event in global.asa

    Darlene Gauthier, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,419
    Karl Seguin
    Jul 23, 2003
  2. Wayne
    Replies:
    2
    Views:
    467
    Wayne
    Nov 11, 2003
  3. Seguros Catatumbo
    Replies:
    16
    Views:
    1,163
    Juan T. Llibre
    Sep 14, 2007
  4. Vince C.
    Replies:
    1
    Views:
    239
    Vince C.
    Apr 3, 2004
  5. Noozer
    Replies:
    3
    Views:
    415
    Noozer
    Jul 19, 2005
Loading...

Share This Page