Losing cookie values

Discussion in 'ASP .Net' started by David, Oct 13, 2006.

  1. David

    David Guest

    Using VS2005 and ASP.Net. I am going between 2 aspx pages. I set cookies in
    page 1, go to page 2 and then return to page 1 via postBackURL. When I get
    back to page 1 all of the cookie values are gone and I don't do anything
    with them in page 2. Any help on what might be wrong? Thanks.

    David
    David, Oct 13, 2006
    #1
    1. Advertising

  2. David

    JP.Gantlin Guest

    are checking for case?
    cookies are strict about case.
    JP.Gantlin, Oct 13, 2006
    #2
    1. Advertising

  3. David

    David Guest

    I think I found the problem. The cookie was a collection of items for
    example:

    Response.Cookies("sqlsearch")("issue") = "0"

    Response.Cookies("sqlsearch")("startdate") = "10/1/2006"

    Response.Cookies("sqlsearch")("enddate") = "10/15/2006"

    Response.Cookies("sqlsearch").Expires = DateTime.Now.AddDays(1)

    When I tried to change just 1 "item" in the collection, I was losing the
    values in the others. I was using the following to change just the enddate
    item

    Response.Cookies("sqlsearch")("enddate") = "10/15/2006"

    Response.Cookies("sqlsearch").Expires = DateTime.Now.AddDays(1)

    When I did this, I lost the other 2 values.

    David

    "JP.Gantlin" <> wrote in message
    news:...
    > are checking for case?
    > cookies are strict about case.
    >
    David, Oct 14, 2006
    #3
    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. jdl1291$pam
    Replies:
    7
    Views:
    608
  2. Philip Townsend

    TextBox Controls losing their values

    Philip Townsend, Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    404
  3. =?Utf-8?B?TWljaGFlbA==?=

    Losing ASP.Net session ID in Cookie

    =?Utf-8?B?TWljaGFlbA==?=, Feb 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,288
    =?Utf-8?B?TWljaGFlbA==?=
    Feb 9, 2004
  4. =?Utf-8?B?Y0ZsZXVyeQ==?=

    public vars losing values

    =?Utf-8?B?Y0ZsZXVyeQ==?=, Jan 31, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    341
    Scott Allen
    Feb 1, 2005
  5. Jason C
    Replies:
    4
    Views:
    673
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page