Due to the way a third party API functions a message needs to be passed back from the server via a Cookie so that it survives redirects.
If the server is putting a message in a cookie called 'message' then I'm collecting it out of a ConnectionRequest and saving it for display to the user later.
This code makes the connection request and logs the cookies that are received.
ConnectionRequest makeRequest = new ConnectionRequest(postURL, true) {
@Override
protected void cookieReceived(Cookie c) {
Log.p(c.getName());
Log.p(c.getValue());
if (c.getName().equals("message")) {
//Save message for display here
}
}
};
On android and in the simulator it will log one and only one Cookie called 'message' and work correctly. On iOS it will log one and only one Cookie called 'PHPSESSID' and therefore no message will be collected or saved.
The server doesn't change its response based on the user agent or anything like that, it just processes the request, sets the cookie with the appropriate message and returns a redirect to the correct endpoint. It appears that the code above is being handled differently by the codename one client on different platforms.
Expected behaviour is that all cookies received are logged with the code above and that Android, iOS and the simulator function the same.
How do I get the 'message' cookie on iOS?
It sounds like the behavior is broken for both cases as I'm assuming both receive the same cookie values but each ignores one of the cookies. Please add this code to the connection request to try and see if the problem is in the getHeaders or in the Cookie implementation:
Depending on the results of this I'll revise the answer. I'd like to see the results both from the simulator and iOS. Just edit your question and paste the results below then comment here so I see the change was made.