Project: titanium
Issue TIMOB-17573: iOS: Unable to Set Multiple Cookies in Request Header
h6.IOS: Fail to Set Multiple Cookie in Request Header for Ti.Network.HTTPClient in SDK 3.3.0 h6.Reproduce and Test Case: {code:title=app.js} var sessionid = Ti.App.getSessionId(); var token = "example_token"; var contextid = '1234567'; var endpoint = "http://127.0.0.1:8888"; //Ti.API.info(endpoint); var loader = Titanium.Network.createHTTPClient({ onload : function(e) { Ti.API.info("Received text: " + this.responseText); alert("Received text: " + this.responseText); alert('success'); }, onerror : function(e) { Ti.API.debug(e.error); alert('error'); }, timeout : 5000 // in milliseconds }); loader.open("GET", endpoint); loader.setRequestHeader('Content-Type', 'application/json;charset=utf-8'); loader.setRequestHeader('User-Agent', Titanium.userAgent); loader.setRequestHeader('Cookie', 'Context='+contextid); loader.setRequestHeader('Cookie', 'sessionID='+sessionid); loader.setRequestHeader('Cookie', 'Auth_token='+token); loader.send(); {code} h6.Expect Result: Server host can get all three cookie information. For example: {code} Context=1234567; sessionID=486E0EFB-C4A1-478A-9A5B-A9EB683B310C; Auth_token=example_token {code} h6.Actual Result: Only the last cookie has been passed to server. For example: {code} Auth_token=example_token {code} It seems like the previous cookies property will be overwritten by the next when you set multiple cookies information at one request header on SDK 3.3.0.GA. N.B. Only happens in 3.3.0.GA. It works well in 3.2.3 and 3.2.1.
Story points: 5