Tracing modified cookies

Discussion in 'ASP General' started by Darin, Sep 30, 2004.

  1. Darin

    Darin Guest

    I hope this is the appropriate discussion group...

    To update a cookie that already exists in the request, I'm calling
    Response.Cookies.Add(...) The debugger indicates that Response.Cookies then
    contains one object, as I expected.

    When I enable pageOutput tracing, however, the Cookies Collection section
    shows the cookie name twice, apparently with the old and new values.

    Why is it appearing twice? Does this section simply mix values from the
    Request and Response cookie collections, or do I need to delete it somewhere
    before adding it to Response.Cookies?

    Thanks!
    Darin, Sep 30, 2004
    #1
    1. Advertising

  2. Darin

    [MSFT] Guest

    Hello,

    Is it an ASP.NET issue? If you delete all clients cookie in IE and test
    again, will the problem disppear?

    Luke
    [MSFT], Oct 6, 2004
    #2
    1. Advertising

  3. Darin

    Darin Guest

    Yes, ASP.NET.

    The cookie is an authentication cookie for a custom authentication system.
    After I 'log out', the cookie goes away as expected so it doesn't seem to be
    an IE issue.

    It's possible that Trace simply shows request AND response cookies in the
    same list, so that when you update a cookie it appears twice (once for the
    cookie header in the request and again for the cookie in the response). I
    just wanted to verify that it's not a bug in my code that's making it appear
    twice.

    "[MSFT]" wrote:

    > Hello,
    >
    > Is it an ASP.NET issue? If you delete all clients cookie in IE and test
    > again, will the problem disppear?
    >
    > Luke
    >
    >
    Darin, Oct 6, 2004
    #3
  4. Darin

    [MSFT] Guest

    Based on my experice, this may happen after a post back on the web page.
    Anyway, the value and idex of cookie won't be changed. Normally, this
    won't cause a problem. We can ignore it in development.

    Luke
    [MSFT], Oct 7, 2004
    #4
  5. Darin

    [MSFT] Guest

    Furthermore, you may check your code to see if the cookie can be added
    twice in server side code, this also can cause such a problem.

    Luke
    [MSFT], Oct 7, 2004
    #5
  6. Darin

    [MSFT] Guest

    Any futher questions on this issue? If there is still any concerns, please
    feel free to let me know.

    Luke
    [MSFT], Oct 8, 2004
    #6
    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. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,478
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,518
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    658
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. archana
    Replies:
    1
    Views:
    503
  5. _Who
    Replies:
    7
    Views:
    2,653
Loading...

Share This Page