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

Windows: HttpClient.clearCookies freezes app

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.0
    • Fix Version/s: Release 7.5.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      2018 Sprint 05 SDK, 2018 Sprint 04 SDK, 2018 Sprint 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 15 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK

      Description

      Ti.Network.HttpClient.clearCookies hangs. It also doesn't clear the cache.

      var win = Ti.UI.createWindow({
          backgroundColor: 'white'
      });
       
      win.addEventListener('open', function () {
          var xhr = Ti.Network.createHTTPClient(),
              cookie_string;
          function second_cookie_fn() {
              Ti.API.info('Set-Cookie: ' + this.getResponseHeader('Set-Cookie'));
              var second_cookie_string = this.getResponseHeader('Set-Cookie').split(';')[0];
              // New Cookie should be different.
              Ti.API.info('OLD: ' + cookie_string);
              Ti.API.info('NEW: ' + second_cookie_string);
              win.backgroundColor = 'green';
          }
          xhr.setTimeout(3e4);
          xhr.onload = function () {
              Ti.API.info('Set-Cookie: ' + this.getResponseHeader('Set-Cookie'));
              cookie_string = this.getResponseHeader('Set-Cookie').split(';')[0];
              xhr.clearCookies('https://my.appcelerator.com');
              xhr.onload = second_cookie_fn;
              setTimeout(function () {
                  xhr.open('GET', 'https://my.appcelerator.com/auth/login');
                  xhr.send();
              }, 5000);
          };
          xhr.onerror = function (e) {
              Ti.API.warn(e);
              win.backgroundColor = 'red';
          };
          xhr.open('GET', 'https://my.appcelerator.com/auth/login');
          xhr.send();
      });
       
      win.open();
      

      Expected: App should not freeze and New cookie should be different.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                kiguchi Kota Iguchi
                Reviewer:
                Gary Mathews
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code