Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap session (cookies) on iOS

On server we have a set of JSON APIs.

There's a login method that authenticates the user and creates user session. Subsequent calls to other methods on the API assume that the user is authenticated.

On client side we have PhoneGap and jQuery mobile. We use ajax calls to communicate with server.

On Android session management is OK, but on iOS after login it seems like the session cookie is not sent back on next call (or is not accepted at all) and the calls fail on server as if the user is not authenticated.

When tested from Safari on the same device everything works fine.

Same behaviour is on iPad 2 with iOS 5.0 and iPhone 4S with iOS 5.1.

Any idea?

like image 612
emirc Avatar asked Apr 04 '12 21:04

emirc


1 Answers

the problem was with UserAgent string. ASP.NET needs to be configured to accept Mozilla/iOS. See Asp.Net Forms Authentication when using iPhone UIWebView

like image 90
emirc Avatar answered Oct 25 '22 04:10

emirc