Cookies in global.asa

Discussion in 'ASP General' started by ou812@ou812.com, Jun 24, 2004.

  1. Guest

    Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
    this code in three separate files.

    <-- Global.asa -->
    sub Session_OnStart
    response.cookies("test") = "-1"
    end sub
    <-- Global.asa -->

    <-- testcookie1.asp -->
    <%Response.Redirect("testcookie2.asp")%>
    <-- testcookie1.asp -->

    <-- testcookie2.asp -->
    <%=request.cookies("test")%>
    <-- testcookie2.asp -->

    I get "-1" on testcookie2.asp

    Anyone else get the same result?
    Why am I getting the cookie in this test?
     
    , Jun 24, 2004
    #1
    1. Advertising

  2. Is global.asa on your own machine? Are you sure you set the block in that
    zone?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    <> wrote in message
    news:...
    > Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
    > this code in three separate files.
    >
    > <-- Global.asa -->
    > sub Session_OnStart
    > response.cookies("test") = "-1"
    > end sub
    > <-- Global.asa -->
    >
    > <-- testcookie1.asp -->
    > <%Response.Redirect("testcookie2.asp")%>
    > <-- testcookie1.asp -->
    >
    > <-- testcookie2.asp -->
    > <%=request.cookies("test")%>
    > <-- testcookie2.asp -->
    >
    > I get "-1" on testcookie2.asp
    >
    > Anyone else get the same result?
    > Why am I getting the cookie in this test?
    >
    >
    >
     
    Aaron [SQL Server MVP], Jun 24, 2004
    #2
    1. Advertising

  3. Guest

    On Thu, 24 Jun 2004 16:34:50 -0400, "Aaron [SQL Server MVP]"
    <> wrote:

    Nope. The script runs on a commercial host in Canada, not on my
    intranet. All I wanted to do was "test" for cookies and I found that
    this would just "take" the cookie regardless of the browser settings.


    I guess it's taking the cookie because it IS displaying a string
    value, although the privacy report (via the icon at the bottom of the
    page) states it "blocked" cookies on pages.


    >Is global.asa on your own machine? Are you sure you set the block in that
    >zone?
    >
    >--
    >http://www.aspfaq.com/
    >(Reverse address to reply.)
    >
    >
    >
    >
    ><> wrote in message
    >news:...
    >> Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
    >> this code in three separate files.
    >>
    >> <-- Global.asa -->
    >> sub Session_OnStart
    >> response.cookies("test") = "-1"
    >> end sub
    >> <-- Global.asa -->
    >>
    >> <-- testcookie1.asp -->
    >> <%Response.Redirect("testcookie2.asp")%>
    >> <-- testcookie1.asp -->
    >>
    >> <-- testcookie2.asp -->
    >> <%=request.cookies("test")%>
    >> <-- testcookie2.asp -->
    >>
    >> I get "-1" on testcookie2.asp
    >>
    >> Anyone else get the same result?
    >> Why am I getting the cookie in this test?
    >>
    >>
    >>

    >
    >
     
    , Jun 24, 2004
    #3
  4. Mark Schupp Guest

    I am not familiar enough with cookies to be sure but you are setting the
    cookie with every request.

    If all cookies are blocked then session_onstart will fire for every request
    (each request will be a new session).

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    <> wrote in message
    news:...
    > Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
    > this code in three separate files.
    >
    > <-- Global.asa -->
    > sub Session_OnStart
    > response.cookies("test") = "-1"
    > end sub
    > <-- Global.asa -->
    >
    > <-- testcookie1.asp -->
    > <%Response.Redirect("testcookie2.asp")%>
    > <-- testcookie1.asp -->
    >
    > <-- testcookie2.asp -->
    > <%=request.cookies("test")%>
    > <-- testcookie2.asp -->
    >
    > I get "-1" on testcookie2.asp
    >
    > Anyone else get the same result?
    > Why am I getting the cookie in this test?
    >
    >
    >
     
    Mark Schupp, Jun 24, 2004
    #4
  5. Zenobia Guest

    On Thu, 24 Jun 2004 20:48:51 GMT, wrote:

    >On Thu, 24 Jun 2004 16:34:50 -0400, "Aaron [SQL Server MVP]"
    ><> wrote:
    >
    >Nope. The script runs on a commercial host in Canada, not on my
    >intranet. All I wanted to do was "test" for cookies and I found that
    >this would just "take" the cookie regardless of the browser settings.
    >
    >I guess it's taking the cookie because it IS displaying a string
    >value, although the privacy report (via the icon at the bottom of the
    >page) states it "blocked" cookies on pages.


    Maybe the browser just blocks permanent cookies which are stored
    on disk after the session's over? ASP session cookies are only
    temporary and are destroyed when the session ends. To set a
    permanent cookie with ASP give the cookie an expiry date.
    Compare how it behaves with both types: permanent and sessional.

    A browser that blocked all cookies wouldn't work with ASP.
     
    Zenobia, Jun 26, 2004
    #5
    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,426
    Karl Seguin
    Jul 23, 2003
  2. Wayne
    Replies:
    2
    Views:
    476
    Wayne
    Nov 11, 2003
  3. _Who
    Replies:
    7
    Views:
    2,686
  4. Amit D.Shinde
    Replies:
    2
    Views:
    196
    Bã§TãRÐ
    Jul 27, 2004
  5. bb
    Replies:
    0
    Views:
    564
Loading...

Share This Page