Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17573

iOS: Unable to Set Multiple Cookies in Request Header

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 4.1.0
    • Component/s: iOS
    • Environment:

      Titanium SDK 3.3.0.GA
      IOS 7.0

    • Story Points:
      5
    • Sprint:
      2015 Sprint 11 SDK

      Description

      IOS: Fail to Set Multiple Cookie in Request Header for Ti.Network.HTTPClient in SDK 3.3.0
      Reproduce and Test Case:

      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(); 
      

      Expect Result:

      Server host can get all three cookie information.
      For example:

      Context=1234567; sessionID=486E0EFB-C4A1-478A-9A5B-A9EB683B310C; Auth_token=example_token
      

      Actual Result:

      Only the last cookie has been passed to server.
      For example:

      Auth_token=example_token
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              sliang Shuo Liang
              Reviewer:
              Hieu Pham
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-19118
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code