Using Phonegap-3.0.0
+ios6.1
, on a real iphone, on a real https domain handling the server side, many responses from different sources lead me to many trials and failures to deal with session cookies, I still cannot handle it correctly on an Iphone5+Phonegap app
, although everything works perfectly in Iphone5+Safari
.
Sources of info & Understanding
Cookies-in-PhoneGap. This suggest to use another transport mechanism to exchange the cookie between clients and server. Deal with the cookies on the wire (javascript
set:document.cookie=...
andget:xhr.getResponseHeader('Set-Cookie')
) and keep it in Phonegap-html5-LocalStorage, to fetch it and reset it in the next ajax request.Iphone & Phonegap. I have located this cocoa code in the file
app>Classes>AppDelegate.m
. I do not think I have to modify it. It seems by default activated. My php server still tell meYour session has timed out, or you have disabled cookies.
.
I have been dealing with this client-server for months in different contexts, always worked, until phonegap came into the picture.
Questions
- From the web readings, phonegap should already be set to go for cookie support. Right or not ?
- Does Phonegap really handle cookies by default (as is when creating a project) ?
- Is cookie handling transport mechanism must be implemented by the developer ?
Thanks in advance.