Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1936] Ti.Network.addHTTPCookie doesn't work

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2014-01-31T04:40:44.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Studio
Labelsn/a
ReporterTimothy Liu
AssigneeRitu Agrawal
Created2014-01-23T23:15:39.000+0000
Updated2016-03-08T07:40:51.000+0000

Description

We're using api key authentication for our app, but the new cookie management in 3.2.0 for Android is obfuscated and does not work as expected. I need to grab cookies from the webview and then load the cookies into our HttpClient requests. iOS uses the same cookie store, but Android needs to use the new cookie system introduced in 3.2.0. I'm able to retrieve the cookies using: Ti.Network.getSystemCookies() from the WebView. However, when I run: Ti.Network.addHTTPCookie(cookie); It fails. What has worked is manually generating the cookie string and setting it as a header with setRequestHeader('Cookie:', ); I feel like that's not the correct way to do it. Thanks!

Comments

  1. Ritu Agrawal 2014-01-24

    Android and iOS platforms use different cookie management scheme so Titanium SDK 3.2.0 tries to bring parity between these two platforms. You may want to try the sample attached with TIMOB-15244 ticket and see if it resolves your issue.
  2. Ritu Agrawal 2014-01-31

    Resolving this ticket as the reporter did not follow up on the suggestion and did not provide a runnable test case to reproduce this problem.

JSON Source