PhoneGap session (cookies) on iOS

匆匆过客 提交于 2019-12-10 02:06:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/10019418/phonegap-session-cookies-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!