getting Reffering site info

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VGRhclRkYXI=?=

    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
  • Evertjan.

    #2
    Re: getting Reffering site info

    =?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
    microsoft.publi c.inetserver.as p.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.ServerV ariables("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)

    Comment

    • =?Utf-8?B?VGRhclRkYXI=?=

      #3
      Re: getting Reffering site info

      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.publi c.inetserver.as p.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.ServerV ariables("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)
      >

      Comment

      • Evertjan.

        #4
        Re: getting Reffering site info

        =?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
        microsoft.publi c.inetserver.as p.general:
        "Evertjan." wrote:
        >
        >=?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
        >microsoft.publ ic.inetserver.a sp.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.ServerV ariables("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)

        Comment

        • =?Utf-8?B?VGRhclRkYXI=?=

          #5
          Re: getting Reffering site info

          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.publi c.inetserver.as p.general:
          >
          "Evertjan." wrote:
          =?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
          microsoft.publi c.inetserver.as p.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.ServerV ariables("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)
          >

          Comment

          • Evertjan.

            #6
            Re: getting Reffering site info

            =?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
            microsoft.publi c.inetserver.as p.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.publ ic.inetserver.a sp.general:
            >>
            "Evertjan." wrote:
            >
            >=?Utf-8?B?VGRhclRkYXI =?= wrote on 23 jul 2007 in
            >microsoft.publ ic.inetserver.a sp.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.ServerV ariables("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)

            Comment

            • Bob Barrows [MVP]

              #7
              Re: getting Reffering site info

              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"


              Comment

              • =?Utf-8?B?VGRhclRkYXI=?=

                #8
                Re: getting Reffering site info

                in global.asa and in global.asax

                Sub Session_OnStart
                Session("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                End Sub


                When I run a test to see if it worked I get nothing
                EX:
                <body>
                <%=Session("Whe reFrom")%>
                </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"
                >
                >
                >

                Comment

                • Bob Barrows [MVP]

                  #9
                  Re: getting Reffering site info

                  TdarTdar wrote:
                  in global.asa and in global.asax
                  >
                  Sub Session_OnStart
                  Session("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                  End Sub
                  >
                  >
                  When I run a test to see if it worked I get nothing
                  EX:
                  <body>
                  <%=Session("Whe reFrom")%>
                  </body>
                  >
                  I see. yes, the code to assign the value for Session("WhereF rom") 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"


                  Comment

                  • =?Utf-8?B?VGRhclRkYXI=?=

                    #10
                    Re: getting Reffering site info

                    Hi,
                    I was thinking the same thing untill i saw this article

                    and this code from it

                    Sub Session_onStart ()
                    On Error Resume Next
                    strSQL = "INSERT INTO Sessions " _
                    &
                    "(EventType,URL ,Referer,Remote Host,UserAgent, UALanguage,User ID,HostIP)" _
                    & " VALUES ('New Session', '" _
                    & Request.ServerV ariables("URL") & "', '" _
                    & Request.ServerV ariables("HTTP_ REFERER") & "', '" _
                    & Request.ServerV ariables("REMOT E_HOST") & "', '" _
                    & Request.ServerV ariables("HTTP_ USER_AGENT") & "', '" _
                    & Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE ") & "', " _
                    & CLng(Session.Se ssionID) & ", '" _
                    & Request.ServerV ariables("LOCAL _ADDR") & "')"
                    WriteSessionDat a(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("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                    End Sub


                    When I run a test to see if it worked I get nothing
                    EX:
                    <body>
                    <%=Session("Whe reFrom")%>
                    </body>
                    I see. yes, the code to assign the value for Session("WhereF rom") 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"
                    >
                    >
                    >

                    Comment

                    • Anthony Jones

                      #11
                      Re: getting Reffering site info

                      "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcomwrote in message
                      news:%23WZMpz5z HHA.4928@TK2MSF TNGP05.phx.gbl. ..
                      TdarTdar wrote:
                      in global.asa and in global.asax

                      Sub Session_OnStart
                      Session("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                      End Sub


                      When I run a test to see if it worked I get nothing
                      EX:
                      <body>
                      <%=Session("Whe reFrom")%>
                      </body>
                      I see. yes, the code to assign the value for Session("WhereF rom") 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


                      Comment

                      • Anthony Jones

                        #12
                        Re: getting Reffering site info

                        "TdarTdar" <TdarTdar@discu ssions.microsof t.comwrote in message
                        news:1F2B30B5-1447-481B-A5B1-14A6DAFBB732@mi crosoft.com...
                        Hi,
                        I was thinking the same thing untill i saw this article

                        and this code from it
                        >
                        Sub Session_onStart ()
                        On Error Resume Next
                        strSQL = "INSERT INTO Sessions " _
                        &
                        "(EventType,URL ,Referer,Remote Host,UserAgent, UALanguage,User ID,HostIP)" _
                        & " VALUES ('New Session', '" _
                        & Request.ServerV ariables("URL") & "', '" _
                        & Request.ServerV ariables("HTTP_ REFERER") & "', '" _
                        & Request.ServerV ariables("REMOT E_HOST") & "', '" _
                        & Request.ServerV ariables("HTTP_ USER_AGENT") & "', '" _
                        & Request.ServerV ariables("HTTP_ ACCEPT_LANGUAGE ") & "', " _
                        & CLng(Session.Se ssionID) & ", '" _
                        & Request.ServerV ariables("LOCAL _ADDR") & "')"
                        WriteSessionDat a(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


                        Comment

                        • Bob Barrows [MVP]

                          #13
                          Re: getting Reffering site info

                          Anthony Jones wrote:
                          "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcomwrote in message
                          news:%23WZMpz5z HHA.4928@TK2MSF TNGP05.phx.gbl. ..
                          >TdarTdar wrote:
                          >>in global.asa and in global.asax
                          >>>
                          >>Sub Session_OnStart
                          >> Session("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                          >>End Sub
                          >>>
                          >>>
                          >>When I run a test to see if it worked I get nothing
                          >>EX:
                          >><body>
                          >> <%=Session("Whe reFrom")%>
                          >></body>
                          >>>
                          >I see. yes, the code to assign the value for Session("WhereF rom")
                          >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"


                          Comment

                          • =?Utf-8?B?VGRhclRkYXI=?=

                            #14
                            Re: getting Reffering site info

                            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]" <reb01501@NOyah oo.SPAMcomwrote in message
                            news:%23WZMpz5z HHA.4928@TK2MSF TNGP05.phx.gbl. ..
                            TdarTdar wrote:
                            >in global.asa and in global.asax
                            >>
                            >Sub Session_OnStart
                            > Session("WhereF rom") = Request.ServerV ariables("HTTP_ REFERER")
                            >End Sub
                            >>
                            >>
                            >When I run a test to see if it worked I get nothing
                            >EX:
                            ><body>
                            > <%=Session("Whe reFrom")%>
                            ></body>
                            >>
                            I see. yes, the code to assign the value for Session("WhereF rom")
                            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"
                            >
                            >
                            >

                            Comment

                            • Anthony Jones

                              #15
                              Re: getting Reffering site info

                              "TdarTdar" <TdarTdar@discu ssions.microsof t.comwrote in message
                              news:5F16804E-3BA3-400A-BD92-3901DA5B7B74@mi crosoft.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



                              Comment

                              Working...