Scott
Scott

Reputation: 117

Cookies in Phonegap iOS App

Just wondering if someone can help me out on an issue that we are experiencing with cookies and Phonegap on iOS.

I have a login service that I call in my app that is located at http://domain.name/fishing/login

It sets a cookie on my device called, "JSESSIONID" with a path of '/fishing/'.

All future requests to the server include that cookie and everything is groovy.

However, when I call the logout service (http://domain.name/fishing/logout) it clears out the JSESSIONID on the server but not on my device. So every future attempt to communicate with the server uses the old cookie value and is denied access.

Even when I try to log in again, the old cookie is still there and does not get replaced with a new one.

I've tried to manually clear the cookie through javascript but haven't had any luck. I can't even read it. Maybe because the webview is loading a file based document and is not on the same domain as the server?

Any suggestions/advice?

Thanks!

Upvotes: 1

Views: 1104

Answers (1)

contactabbas
contactabbas

Reputation: 832

You might want to have a look at the plugin http://plugreg.com/plugin/bez4pieci/Phonegap-Cookies-Plugin

Upvotes: 1

Related Questions