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.
https://github.com/appcelerator/titanium_mobile_windows/pull/1186
*FR Passed - Waiting on Jenkins*
*Closing ticket* The fix is present in SDK; {noformat} 7.5.0.v20180922081022 {noformat}