Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15244] Android: Expose cookie management methods for HTTPClient and WebView

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-23T00:18:54.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 22, 2013 Sprint 22 API, Release 3.2.0
ComponentsAndroid
Labelsmodule_network, qe-testadded
ReporterPing Wang
AssigneePing Wang
Created2013-09-17T20:56:00.000+0000
Updated2013-11-20T00:10:10.000+0000

Description

In Android, HttpClient does not share cookies with WebView. Need to expose the cookie management methods so developers can manage their cookies. Reference: http://developer.android.com/reference/android/webkit/CookieManager.html http://developer.android.com/reference/org/apache/http/client/CookieStore.html http://developer.android.com/reference/org/apache/http/impl/cookie/BasicClientCookie.html

Attachments

FileDateSize
timob15244.zip2013-10-18T00:50:43.000+0000755123

Comments

  1. Ping Wang 2013-10-18

    PR: https://github.com/appcelerator/titanium_mobile/pull/4804 For FR: 1. Run the attached project "timob15244". 2. Click "Test System Cookies". i) Click "add system cookies". It should add 5 cookies to the system cookie store. ii) Click "get system cookies: mydomain.com, /, null". Should show an alert with 2 cookies: cookie1 and COOKIE1. *Note*: only name and value are specified; all the other properties are undefined. This behavior has been documented in the PR. iii) Click "get system cookies: www.mydomain.com, /, null". Should show an alert with 3 cookies: cookie1, COOKIE1 and cookie4. iv) Click "get system cookies: .mydomain.com, /foo/, null". Should show 3 cookies: cookie3, cookie1 and COOKIE1. v) Click "get system cookies: www.mydomain.com, /foo/, null". Should show 4 cookies: cookie3, cookie1, COOKIE1, cookie4. vi) Click "get system cookies: www.mydomain.com, /FOO/, cookie5". Should show 1 cookie: cookie5. vii) Click "remove system cookies: .mydomain.com, null, COOKIE1" and then "get system cookies: mydomain.com, /, null". Should show 1 cookie: cookie1. viii) Click "remove all system cookies" and then "get system cookies: mydomain.com, /, null". Should show "null". 3. Go back to the main window with the table view. Click "Test HTTP Cookies". i) Repeat Step 2 i)-iv). ii) Click "get HTTP cookies for domain: .mydomain.com". Should show 3 cookies: cookie1, COOKIE1 and cookie3. iii) Click "get HTTP cookies for domain: www.mydomain.com". Should show 5 cookies: cookie1, COOKIE1, cookie3, cookie4 and cookie5. iv) Click "remove HTTP cookies: .mydomain.com, null, COOKIE1" and then "get HTTP cookies: mydomain.com, /, null". Should show 1 cookie: cookie1. v) Click "add HTTP cookies". Click "remove HTTP cookies for domain: .mydomain.com". Click "get HTTP cookies for domain: www.mydomain.com". Should show 2 cookies: cookie4 and cookie5. vi) Click "add HTTP cookies". Click "remove HTTP cookies for domain: www.mydomain.com". Click "get HTTP cookies for domain: www.mydomain.com". Should show "null". 4. Go back to the main window. Click "Test Cookies for www.google.com". Dismiss the alert "HTTP client onload". i) Click "getSystemCookies". Should show 2 cookies: PREF and NID. ii) Click "getHTTPCookies". Should show 2 cookies: NID and PREF. 5. Run Anvil->network_httpclient. All tests should pass.
  2. Hieu Pham 2013-10-23

    CR + FR

JSON Source