Hi

The fix has just been committed, I did at at lunch time but thought of 
committing in the evening :-)
There're few workarounds at the moment but the simplest is to do

@HttpHeader("Cookie") List<Cookie> cookies

thanks, Sergey

----- Original Message ----- From: "jongraf" <[email protected]>
To: <[email protected]>
Sent: Tuesday, November 10, 2009 3:18 PM
Subject: Using @CookieParam to retrieve a cookie only returns the last cookie



Hello all,

While attempting to use @CookieParam to get a cookie where many cookies
exist, I discovered that it does not matter what cookie name is requested.
As long as cookies exist in the HTTP Request, the last cookie in the
collection of cookies will be returned.

Problem class: org.apache.cxf.jaxrs.utils.JAXRSUtils

In JAXRSUtils.processCookieParam(), if there are multiple cookies in the
header, only the last cookie will be returned when Cookie.valueOf() is
called.

This is because the list of all cookies is returned from values.get(0).
When Cookie.valueOf() is called, it delegates to CookieHeaderProvider which
simply loops through all of the tokenized cookie values and returns the last
cookie.

I have opened CXF-2529 to track this.

Has anyone else encountered this or successfully used @CookieParam?

Jonathan
--
View this message in context: http://old.nabble.com/Using-%40CookieParam-to-retrieve-a-cookie-only-returns-the-last-cookie-tp26284850p26284850.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to