Re: Cookies only being duplicated

Discussion in 'ASP .Net' started by landeiro@gmail.com, Jan 7, 2005.

  1. Guest

    I'm having the same problem. Who knows how to resolve this situation?

    Benbrook wrote:
    > Hello
    >
    > I am writing an ASP.NET application that evaluates in-memory cookies

    set by
    > the classic ASP page that called it. This is not a problem; my .NET

    page is
    > able to see the cookies set in the classic ASP page.
    >
    > However, when I attempt to modify the value of that existing cookie

    and
    > repost, the cookie is not changed, but shows up twice --- one with

    the
    > original value and one with the new value.
    >
    > This is not a path issue. Both cookies are being stored in the "/"

    path.
    >
    > I am attempting to alter the cookie value as such:
    >
    > Response.Cookies["CookieName"].Value = "1234"; // <--- Causes a

    duplicate
    > in the next post
    >
    > Oddly enough, I am able to make the code work, if I use a loop as

    follows,
    > rather than using the cookie name directly:
    >
    > for (int i = 0; i < Request.Cookies.Count; i++)
    > if (Request.Cookies.Name = "CookieName")
    > Request.Cookies.Value = "1234";
    >
    > Notice I am making the modification in the Request object, not

    Response.
    > This works, but I would like to understand WHY the former code does

    not
    > behave as expected. To make things worse, this code DOES function

    properly
    > on another machine (Same code, pulled from source control). Could

    this be
    > an IIS issue?
    >
    > Any light that could be shed on this would be immensely appreciated.
    >
    > -Anthony M. Benbrook
    >
    , Jan 7, 2005
    #1
    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. Tom
    Replies:
    6
    Views:
    383
  2. =?Utf-8?B?SXNhYmVsIFB1aWdkZXZhbGw=?=

    Duplicated records in a report from two tables

    =?Utf-8?B?SXNhYmVsIFB1aWdkZXZhbGw=?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    =?Utf-8?B?SXNhYmVsIFB1aWdkZXZhbGw=?=
    Apr 6, 2005
  3. =?Utf-8?B?QW5kcmU=?=
    Replies:
    0
    Views:
    391
    =?Utf-8?B?QW5kcmU=?=
    Oct 27, 2005
  4. _Who
    Replies:
    7
    Views:
    2,632
  5. Replies:
    4
    Views:
    104
Loading...

Share This Page