<分区>
我正在编写一个 iPhone 应用程序。此应用程序要求用户登录使用 php + mysql 的远程 Web 服务器。服务器如何处理这个?使用 session ? cookies ?独特的ID? 任何关于如何执行此操作的链接/代码/教程都会很棒。
谢谢!
<分区>
我正在编写一个 iPhone 应用程序。此应用程序要求用户登录使用 php + mysql 的远程 Web 服务器。服务器如何处理这个?使用 session ? cookies ?独特的ID? 任何关于如何执行此操作的链接/代码/教程都会很棒。
谢谢!
最佳答案
Get the webservice ready that is build up using php
On login webservice call on account of successful authentication a return a random string keep it in a session variable in server side and save it in a plist or sqlite db
After that every time you make a request call send a additional retrieved parameter check if both are equal then process the request in server side
Check if the Http response code is not 200 if so then pop all the viewcontrollers and get the app to login page(It means the seesion has expired or any other error.You can handle it appropriately if you read about various http response codes)
关于php - 为 iPhone 应用程序用户管理 Web 服务器上的用户 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1158612/