Tracing modified cookies

D

Darin

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!
 
M

[MSFT]

Hello,

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

Luke
 
D

Darin

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.
 
M

[MSFT]

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
 
M

[MSFT]

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
 
M

[MSFT]

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

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top