java - How do I make Apache HttpClient respect the Path in a Set-Cookie header? -
i have local server running endpoints under /server/public
, /server/saml
, , i'm using httpclient (v4.4.1) interact it. requests endpoint trigger (if client doesn't have session) header set-cookie: jsessionid=abc123; path=/server/
, client should have 1 session.
however, if debug , @ contents of basiccookiestore
, saved cookies have paths /server/public
, /server/saml
, resulting in 2 cookies being saved, , different session cookies being sent depending on endpoint.
i'm using standard cookiespec
, , see same behaviour standard strict.
any ideas what's happening or how can fix it?
it seems issue caused this bug caused path
headers not respected. instead, client strip after last forward slash in url response retrieved from, , use cookie's path. relevant comment scott blum:
namely, mixed-cased cookie attributes not being handled properly. example, if set-cookie header being parsed contained "path=/foo" attribute, path not respected @ all. because attributehandler lookup fail (it's keyed "path").
upgrading httpclient version 4.5 fixed problem.
Comments
Post a Comment