Strange cookie behavior

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Re: Strange cookie behavior

    Maybe the remote server is in a different time zone.

    Ray at work

    --
    Will trade ASP help for SQL Server help


    "AHN" <anerse@excite.com> wrote in message
    news:OjIuozacDHA.1532@TK2MSFTNGP10.phx.gbl...
    > Please tell me somebody what causes the cookie set with
    > <%
    > Response.Cookies("blah") = "Blah blah"
    > Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    > %>
    > work as supposed on my local server but fail on my site on Brinkster. On
    the
    > next page it disappears if used with "Expires" attribute set, and is
    there,
    > if without. It was working some time ago. I was forced to reinstall my OS
    > (W2k, IIS 5.0) since then and already a few days I have this problem.
    >
    > Here is what iis help says:
    > "Expires Write-only. The date on which the cookie expires. This date must
    be
    > set in order for the cookie to be stored on the client's disk after the
    > session ends. If this attribute is not set to a date beyond the current
    > date, the cookie will expire when the session ends.
    > "
    > It does not say I can't set the cookie for one hour. What's wrong?
    > Thanks for any help.
    >
    >
    >
    >
    >

    Ray at Guest

  2. Similar Questions and Discussions

    1. Funky FormsAuthentication Cookie Behavior.
      We are having a problem where the HttpCookie.Value for FormsAuthentication is different between when it is created in Login.aspx.cs and when it is...
    2. Strange Cookie
      In my ASP application, I am giving provisions to my users to search for products based on the criteria furnished by them. I am doing this by making...
    3. #24713 [Opn->Bgs]: strange cookie behaviour
      ID: 24713 Updated by: sniper@php.net Reported By: napalm at spiderfish dot net -Status: Open +Status: ...
    4. #24713 [NEW]: strange cookie behaviour
      From: napalm at spiderfish dot net Operating system: redhat linux PHP version: 4.3.2 PHP Bug Type: Unknown/Other Function...
    5. Why strange IF...ELSE behavior
      Hi all, I'm getting a strange result with the following IF statement: $bar = ($foo == 'last') ? true : false; In my script $foo normaly has...
  3. #2

    Default Strange cookie behavior

    Please tell me somebody what causes the cookie set with
    <%
    Response.Cookies("blah") = "Blah blah"
    Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    %>
    work as supposed on my local server but fail on my site on Brinkster. On the
    next page it disappears if used with "Expires" attribute set, and is there,
    if without. It was working some time ago. I was forced to reinstall my OS
    (W2k, IIS 5.0) since then and already a few days I have this problem.

    Here is what iis help says:
    "Expires Write-only. The date on which the cookie expires. This date must be
    set in order for the cookie to be stored on the client's disk after the
    session ends. If this attribute is not set to a date beyond the current
    date, the cookie will expire when the session ends.
    "
    It does not say I can't set the cookie for one hour. What's wrong?
    Thanks for any help.





    AHN Guest

  4. #3

    Default Re: Strange cookie behavior

    No it is not. I had that thought but checked it already a few days ago.
    Anything else?

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:eBUPi6acDHA.2932@tk2msftngp13.phx.gbl...
    > Maybe the remote server is in a different time zone.
    >
    > Ray at work
    >
    > --
    > Will trade ASP help for SQL Server help
    >
    >
    > "AHN" <anerse@excite.com> wrote in message
    > news:OjIuozacDHA.1532@TK2MSFTNGP10.phx.gbl...
    > > Please tell me somebody what causes the cookie set with
    > > <%
    > > Response.Cookies("blah") = "Blah blah"
    > > Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    > > %>
    > > work as supposed on my local server but fail on my site on Brinkster. On
    > the
    > > next page it disappears if used with "Expires" attribute set, and is
    > there,
    > > if without. It was working some time ago. I was forced to reinstall my
    OS
    > > (W2k, IIS 5.0) since then and already a few days I have this problem.
    > >
    > > Here is what iis help says:
    > > "Expires Write-only. The date on which the cookie expires. This date
    must
    > be
    > > set in order for the cookie to be stored on the client's disk after the
    > > session ends. If this attribute is not set to a date beyond the current
    > > date, the cookie will expire when the session ends.
    > > "
    > > It does not say I can't set the cookie for one hour. What's wrong?
    > > Thanks for any help.
    > >
    > >
    > >
    > >
    > >
    >
    >

    AHN Guest

  5. #4

    Default Re: Strange cookie behavior

    The Expires property on the Response object is a date - not a time...hence
    it expires today.

    from
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/ref_vbom_resoccook.asp?frame=true[/url]

    Write-only. The date on which the Cookie expires. This date must be set
    in order for the Cookie to be stored on the client's disk after the session
    ends. If this attribute is not set to a date beyond the current date, the
    Cookie expires
    when the session ends.



    Brian Staff

    "AHN" <anerse@excite.com> wrote in message
    news:OjIuozacDHA.1532@TK2MSFTNGP10.phx.gbl...
    > Please tell me somebody what causes the cookie set with
    > <%
    > Response.Cookies("blah") = "Blah blah"
    > Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    > %>
    > work as supposed on my local server but fail on my site on Brinkster. On
    the
    > next page it disappears if used with "Expires" attribute set, and is
    there,
    > if without. It was working some time ago. I was forced to reinstall my OS
    > (W2k, IIS 5.0) since then and already a few days I have this problem.
    >
    > Here is what iis help says:
    > "Expires Write-only. The date on which the cookie expires. This date must
    be
    > set in order for the cookie to be stored on the client's disk after the
    > session ends. If this attribute is not set to a date beyond the current
    > date, the cookie will expire when the session ends.
    > "
    > It does not say I can't set the cookie for one hour. What's wrong?
    > Thanks for any help.
    >
    >
    >
    >
    >

    Brian Staff Guest

  6. #5

    Default Re: Strange cookie behavior

    Thanks. I feel so stupid.

    "Brian Staff" <brianstaff@[NoSpam]compuserve.com> wrote in message
    news:u2CnkQpcDHA.2416@TK2MSFTNGP10.phx.gbl...
    > The Expires property on the Response object is a date - not a time...hence
    > it expires today.
    >
    > from
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/[/url]
    ref_vbom_resoccook.asp?frame=true
    >
    > Write-only. The date on which the Cookie expires. This date must be
    set
    > in order for the Cookie to be stored on the client's disk after the
    session
    > ends. If this attribute is not set to a date beyond the current date, the
    > Cookie expires
    > when the session ends.
    >
    >
    >
    > Brian Staff
    >
    > "AHN" <anerse@excite.com> wrote in message
    > news:OjIuozacDHA.1532@TK2MSFTNGP10.phx.gbl...
    > > Please tell me somebody what causes the cookie set with
    > > <%
    > > Response.Cookies("blah") = "Blah blah"
    > > Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    > > %>
    > > work as supposed on my local server but fail on my site on Brinkster. On
    > the
    > > next page it disappears if used with "Expires" attribute set, and is
    > there,
    > > if without. It was working some time ago. I was forced to reinstall my
    OS
    > > (W2k, IIS 5.0) since then and already a few days I have this problem.
    > >
    > > Here is what iis help says:
    > > "Expires Write-only. The date on which the cookie expires. This date
    must
    > be
    > > set in order for the cookie to be stored on the client's disk after the
    > > session ends. If this attribute is not set to a date beyond the current
    > > date, the cookie will expire when the session ends.
    > > "
    > > It does not say I can't set the cookie for one hour. What's wrong?
    > > Thanks for any help.
    > >
    > >
    > >
    > >
    > >
    >
    >

    AHN Guest

  7. #6

    Default Re: Strange cookie behavior

    Don't think you're right. Just read;
    ``If this attribute is not set to a date beyond the current date, the Cookie
    expires when the session ends."
    I could expect that it will be written, and thrown out with the end of the
    session. Besides, its not logical, and also it WORKS on my local server as
    its supposed to. The different timezone idea takes more water, but
    <%Response.Write Now()%> returns the correct time from the big server out
    there.
    Thanks anyway. I found another way. I set the cookie and then keep track of
    the time in some other file, which refreshes itself every 15 secs. As soon
    as the hour is over, I kill the cookie with my bare hands. :)
    Cheers

    "Brian Staff" <brianstaff@[NoSpam]compuserve.com> wrote in message
    news:u2CnkQpcDHA.2416@TK2MSFTNGP10.phx.gbl...
    > The Expires property on the Response object is a date - not a time...hence
    > it expires today.
    >
    > from
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/[/url]
    ref_vbom_resoccook.asp?frame=true
    >
    > Write-only. The date on which the Cookie expires. This date must be
    set
    > in order for the Cookie to be stored on the client's disk after the
    session
    > ends. If this attribute is not set to a date beyond the current date, the
    > Cookie expires
    > when the session ends.
    >
    >
    >
    > Brian Staff
    >
    > "AHN" <anerse@excite.com> wrote in message
    > news:OjIuozacDHA.1532@TK2MSFTNGP10.phx.gbl...
    > > Please tell me somebody what causes the cookie set with
    > > <%
    > > Response.Cookies("blah") = "Blah blah"
    > > Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() )
    > > %>
    > > work as supposed on my local server but fail on my site on Brinkster. On
    > the
    > > next page it disappears if used with "Expires" attribute set, and is
    > there,
    > > if without. It was working some time ago. I was forced to reinstall my
    OS
    > > (W2k, IIS 5.0) since then and already a few days I have this problem.
    > >
    > > Here is what iis help says:
    > > "Expires Write-only. The date on which the cookie expires. This date mus
    t
    > be
    > > set in order for the cookie to be stored on the client's disk after the
    > > session ends. If this attribute is not set to a date beyond the current
    > > date, the cookie will expire when the session ends.
    > > "
    > > It does not say I can't set the cookie for one hour. What's wrong?
    > > Thanks for any help.
    > >
    > >
    > >
    > >
    > >
    >
    >

    AHN Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139