Bug #1114
closedHttp Client response with multiple Set Cookie headers
0%
Description
While processing a response from an Http::Client request, multiple 'Set-Cookie' headers are not properly handled. When there are multiple 'Set-Cookie' headers found within a response, only the last cookie value is preserved; the previous values are overwritten. (Reference: Message::setHeader via Client::handleReadHeaders)
Just thinking through the issue and I thought it would be good to provide a api which separates the cookie from other headers. (Message::Cookie ??) Obviously you would know best and would know how you would like to resolve the issue but multiple 'Set-Cookie' headers should be handled.
Thanks.
Updated by Koen Deforche almost 13 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.2.1
Hey,
You're right. I've fixed this (by having an addHeader() in addition to setHeader()).
Actually, Http::Cookie would be a useful utility class, which could also be used in WApplication::setCookie().
It's hard to draw the line there though, because you could argue that the client should manage the cookies by himself and automatically include a relevant cookie received earlier in a new request ?
Regards,
koen