[
https://issues.apache.org/jira/browse/CB-874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shazron Abdullah updated CB-874:
--------------------------------
Description:
1. Launch the app
2. Login. This saves information in the Webkit's session (I believe)
3. Perform a $.ajax call to the server
4. Expected = Actual: server authenticates client with session and returns
information
5. Now, tap home screen button, double-tap to kill the app, and relaunch
6. Perform the same $.ajax call to the server
7. Expected: server authenticates client with session and returns information
8. Actual: session information doesn't seem to be sent, so server returns HTTP
code 401 Unauthorized
My $.ajax requests are very simple:
$.ajax({
url: 'http://abc.com/info.json',
type: 'GET',
dataType: 'json',
cache: false,
success: function (forms) {
// do stuff
},
error: function (response, textStatus) {
if (response.status == 401) {
// Handle unauthorized.
// XXX This is the code path that is followed on second
invocation.
localStorage.clear();
$.mobile.changePage( "#login" );
} else {
// Handle all other errors
}
},
complete: function () {
// Do stuff
}
});
This code works fine in Chrome and Firefox. It fails in iOS.
was:
- Launch the app
- Login. This saves information in the Webkit's session (I believe)
- Perform a $.ajax call to the server
Expected = Actual: server authenticates client with session and returns
information
- Now, tap home screen button, double-tap to kill the app, and relaunch
- Perform the same $.ajax call to the server
Expected: server authenticates client with session and returns information
Actual: session information doesn't seem to be sent, so server returns HTTP
code 401 Unauthorized
My $.ajax requests are very simple:
$.ajax({
url: 'http://abc.com/info.json',
type: 'GET',
dataType: 'json',
cache: false,
success: function (forms) {
// do stuff
},
error: function (response, textStatus) {
if (response.status == 401) {
// Handle unauthorized.
// XXX This is the code path that is followed on second
invocation.
localStorage.clear();
$.mobile.changePage( "#login" );
} else {
// Handle all other errors
}
},
complete: function () {
// Do stuff
}
});
This code works fine in Chrome and Firefox. It fails in iOS.
numbered the repro steps/results above so they can be easily referred to.
> AJAX session launch when iOS app killed/restarted
> -------------------------------------------------
>
> Key: CB-874
> URL: https://issues.apache.org/jira/browse/CB-874
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 1.7.0
> Environment: iOS 5.1, Cordova 1.7.0, iPad 3
> Reporter: Jason Shah
> Assignee: Shazron Abdullah
>
> 1. Launch the app
> 2. Login. This saves information in the Webkit's session (I believe)
> 3. Perform a $.ajax call to the server
> 4. Expected = Actual: server authenticates client with session and returns
> information
> 5. Now, tap home screen button, double-tap to kill the app, and relaunch
> 6. Perform the same $.ajax call to the server
> 7. Expected: server authenticates client with session and returns information
> 8. Actual: session information doesn't seem to be sent, so server returns
> HTTP code 401 Unauthorized
> My $.ajax requests are very simple:
> $.ajax({
> url: 'http://abc.com/info.json',
> type: 'GET',
> dataType: 'json',
> cache: false,
> success: function (forms) {
> // do stuff
> },
> error: function (response, textStatus) {
> if (response.status == 401) {
> // Handle unauthorized.
> // XXX This is the code path that is followed on second
> invocation.
> localStorage.clear();
> $.mobile.changePage( "#login" );
> } else {
> // Handle all other errors
> }
> },
> complete: function () {
> // Do stuff
> }
> });
> This code works fine in Chrome and Firefox. It fails in iOS.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira