Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14651] Android: Add support for HttpClient Cookie Path Validation

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-08-12T18:27:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
LabelssupportTeam
ReporterEduardo Gomez
AssigneeHieu Pham
Created2013-07-25T00:33:00.000+0000
Updated2017-03-20T18:02:09.000+0000

Description

Feature Request

To add the ability to custom Cookie management for HttpClient Path Validation. To achieve this Titanium could allow to custom cookie policy and registering their own cookie support.

Rationale

When the server is setting a cookie with an invalid path and HttpClient is properly rejecting the cookie. According to the RFC spec, a server must set the cookie path using the URL path, or an ancestor path.

Use case

On Titanium abort a XHR tears down underlying TCP connection which forces client to accept cookies.

Stack Trace

06-13 16:18:22.125: W/ResponseProcessCookies(21195): Cookie rejected: "BasicClientCookie[version=0,name=ObFormLoginCookie,domain=sso.cisco.com,path=/autho/login/loginaction.html,expiry=null]". Illegal path attribute "/autho/login/loginaction.html". Path of origin: "/obrareq.cgi"
To avoid this Browsers can ignore the spec and just accept the cookie.

Additional details

For example, when accessing http://foo.com/a/b/, the server may set a cookie with path /a/b/, /a, or /, but not /a/c. But since most all browsers (I only checked Firefox) ignore the spec and accept the cookie, I need HttpClient to do the same. Similar discussion: http://highaltitudedev.blogspot.mx/2011/03/httpclient-cookie-path-validation.html

Comments

  1. Hieu Pham 2013-08-07

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4549
  2. Ping Wang 2013-08-12

    This feature is not necessary for the customer since what the customer wants is to fix TIMOB-14224.
  3. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source