Issue
Once we call abort() method on xhr (which we need to cancel download), all the subsequent calls to xhr client are failing. The request is going to the server but from the server we are getting the below error:
stack trace
06-13 16:18:22.125: W/ResponseProcessCookies(21195): Cookie rejected: "BasicClientCookie[version=0,name=ObFormLoginCookie,domain=sso.cisco.com,path=/autho/login/loginaction.html,expiry=null]". Illegal path attribute "/autho/login/loginaction.html". Path of origin: "/obrareq.cgi"
- Thread
A similar discussion about how fix this:
http://stackoverflow.com/questions/8279970/accept-all-cookies-via-httpclient
[~egomez] is it possible to extract out an example into a short code snippet showing the failure?
Aborting the xhr request tears down the underlying TCP connection. If you actually see the response from the server after the abort you'll see the code for a Login Page (so the client needs to re-authenticate after abort). The server supports Basic Access Authentication, so setting a basic auth request header instead of the cookie information will work every time (even after abort)
Resolving this as not our bug
Please see feedback to points:
Work arounds
(1) Do a silent login after abort.Feedback:
We cannot ask user to re-login after every abort. As per Cisco policy we should not store the user credential anywhere is app, so we cannot got for Basic authentication. Our Cisco framework gives us a Cookie and which we need re-use, for further server communication. (2) Don't abort. Just ignore the results.Feedback:
This will slow the app, because even we are not downloading the content the data chunk will be downloading to the device. (3) The server seems to support basic authorization. We essentially changed the code in Search.js to send an Authorization Header instead of the ObSSOCookie to get it to work fine even after abort.Feedback:
As mentioned in #1, we should not store user credentials, and we should use the cookies for further server communication.Customer's remarks
"Please provide us a solution to use the cookies, for further communication. This mechanism of Cookies is working fine with iOS implementation and working fine with our apps on iPhone and iPad."master PR: https://github.com/appcelerator/titanium_mobile/pull/4549
Hi, I've tested out PR and works great. As I just wanted to make sure their app runs smoothly and without outstanding issues. I found the following outcome:
Details
User once logged in, attempts to get file "A". If he "aborts" current download the exception below is thrown. When he resumes (click "Download") then he won't be able to abort this file download over again (to be clear: the download will finalize successfully).Device stack trace
Razr Droid 2.3.5 on TiSDK 3.2 CI buildOnce File "A" was downloaded successfully, user attempts to get File "B". Download progress starts off. User aborts. Exception below is thrown. If he resumes by clicking "Download" button they won't be able to abort anymore. But again the file "B" will be downloaded successfully:
Outcomes
- From Android docs: http://developer.android.com/reference/org/apache/http/HttpEntity.html#consumeContent()Do they need to warn users Abort method would work only once? Are these entities throwing an exception when this method is called multiple times? If you need further clarity, or anymore info let me know, thanks.
PR: https://github.com/appcelerator/titanium_mobile/pull/4549
Closing ticket as fixed.