{ "id": "114284", "key": "TIMOB-13885", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-05-13T12:07:20.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:59.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Problem*\r\nUnfortunately with an iOS I can't use/send more than one cookie. With Android it is working without any problems.\r\n\r\n*Test case*\r\n{code:javascript}var win = Titanium.UI.createWindow();\r\n\r\nvar xhr = Ti.Network.createHTTPClient();\r\nxhr.open(\"GET\", \"http://www.some.where\");\r\nxhr.setRequestHeader(\"Cookie\", \"cookieName=value; nextCookieName=nextValue;\");\r\nxhr.send();\r\n\r\nwin.open();{code}\r\n\r\n*Log*\r\n{code}[ERROR] invalid arguments for setting cookie. value should be in the format 'name=value'. in -[TiNetworkHTTPClientProxy setRequestHeader:] (TiNetworkHTTPClientProxy.m:465) [WARN] Exception in event callback. { line = xxx; message = \"invalid arguments for setting cookie. value should be in the format 'name=value'. in -[TiNetworkHTTPClientProxy setRequestHeader:] (TiNetworkHTTPClientProxy.m:465)\"; sourceId = 366760928; sourceURL = \"file://localhost/Users/xxx/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/1EC7C0B6-34E5-4D96-9D79-0685610566E7/xxx.app/xxx.js\"; }{code}\r\n\r\n\r\n*Workarounds*\r\nhttp://developer.appcelerator.com/question/120728/set-cookies-using-setrequestheader--crashed-\r\n\r\n{code:javascript}\r\nif (Titanium.Platform.name == 'iPhone OS') \r\n{\r\n xhr.setRequestHeader(\"Cookie\", \"cookie1=value1\");\r\n xhr.setRequestHeader(\"Cookie\", \"cookie2=value2\");\r\n}\r\nelse\r\n{\r\n var cookieString = \"cookie1=value1; cookie2=value2;\";\r\n xhr.setRequestHeader('Cookie', cookieString);\r\n}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: I can't send more than one cookie", "creator": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Macbook Pro, OSX 10.7.5, iOS Simulator v. 6.0 (369.2). Ti: 3.1.0.GA", "comment": { "comments": [ { "id": "252115", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "have you referenced this Q&A?\n\nhttp://developer.appcelerator.com/question/120728/set-cookies-using-setrequestheader--crashed-", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-15T19:00:43.000+0000", "updated": "2013-05-15T19:00:43.000+0000" }, { "id": "252123", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, I know that I can solve that problem like this... But firstly: If I have too many cookie there's too many work with this. On Android is it working without any problems. I would be very happy if it worked also with iOS. I think that much better is fix this main bug in the Ti than fix it somewhere in the normal application every time. Problem is that this is not only one bug in the Ti/My app. There are too many bugs and my source code than looks absolutely terrible (Everywhere some fix). Also I have to make too much changes between iOS/Android because... Simply awfully. Thank you for understanding ;)\n ", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-15T19:18:57.000+0000", "updated": "2013-05-15T19:18:57.000+0000" }, { "id": "252147", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Absolutely understood. I just wanted to have a workaround at your disposal until this can be properly escalated to the platform team. It seems to be quite clearly a parity issue, that as you state, developers should not need to account for and should be fixed in Titanium.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-15T19:42:55.000+0000", "updated": "2013-05-15T19:42:55.000+0000" }, { "id": "252184", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So I'm guessing that the following\r\n{code:javascript}webView.evalJS('document.cookie;'){code}\r\nreturns multiple variables like\r\n{code:javascript}\"cookie1=value1; cookie2=value2;\"{code}\r\n\r\nIs that right?\r\n\r\nIt would be useful to have a complete simple test case that I can drop into an app.js, run and reproduce the error. With that I can escalate it to engineering.\r\n\r\nThanks.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-15T21:26:00.000+0000", "updated": "2013-05-15T21:26:00.000+0000" }, { "id": "252247", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, you are right. Here is little sample:\r\n\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow();\r\n\r\nvar xhr = Ti.Network.createHTTPClient();\r\nxhr.open(\"GET\", \"http://www.some.where\");\r\nxhr.setRequestHeader(\"Cookie\", \"cookieName=value; nextCookieName=nextValue;\");\r\nxhr.send();\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-16T08:41:16.000+0000", "updated": "2013-05-16T08:41:31.000+0000" }, { "id": "252310", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed on iOS 6 simulator with Ti SDK 3.1 GA and 3.2 CI.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-16T18:14:28.000+0000", "updated": "2013-05-16T18:14:28.000+0000" }, { "id": "279801", "author": { "name": "vlucas", "key": "vlucas", "displayName": "Vance Lucas", "active": true, "timeZone": "America/Chicago" }, "body": "Just ran into this. If cookie values have to be set separately for some reason on iOS, the Titanium code should definitely handle this. Users apps shouldn't hard crash for attempting to set a completely valid and normal \"Cookie\" header value.", "updateAuthor": { "name": "vlucas", "key": "vlucas", "displayName": "Vance Lucas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-11-15T18:05:11.000+0000", "updated": "2013-11-15T18:05:11.000+0000" }, { "id": "300595", "author": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "body": "Any idea when this issue will be addressed?", "updateAuthor": { "name": "btknorr", "key": "btknorr", "displayName": "Brian Knorr", "active": true, "timeZone": "America/Chicago" }, "created": "2014-04-10T21:28:06.000+0000", "updated": "2014-04-10T21:28:06.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }