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

Android: Titanium.Network.addSystemCookie not adding cookie to webview

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Description

      On SDK 5.0 Titanium.Network.addSystemCookie doesn't work as expected when trying to add cookies to a webview.
      In SDK 3.5 our code works fine.
      The use case is that a login is done in the main app and the session cookie returned needs to be used on our webviews.
      Here is the code that does that.

      if (osname === 'android') {
          var sessionCookie = _.findWhere(
              Titanium.Network.getHTTPCookiesForDomain(
                  Ti.App.Properties.getString('siteUrl').match(/^https?:\/\/(?:www\.)?([^\/^:]+)[:\/$]?/i)[1]
              ),
              {name: 'JSESSIONID'}
          );
          Titanium.Network.removeAllSystemCookies();
          Titanium.Network.addSystemCookie(sessionCookie);
      }
      

      I have confirmed that sessionCookie is correct and that it is not being used in the webview (using chrome inspect a simple ajax request doesn't send the cookie).
      This used to work fine on 3.5 (not sure about 4 though, we migrated 3.5 -> 5).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              filaruina Filipe La Ruina
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code