php - 为 iPhone 应用程序用户管理 Web 服务器上的用户 session

标签 php iphone session

<分区>

我正在编写一个 iPhone 应用程序。此应用程序要求用户登录使用 php + mysql 的远程 Web 服务器。服务器如何处理这个?使用 session ? cookies ?独特的ID? 任何关于如何执行此操作的链接/代码/教程都会很棒。

谢谢!

最佳答案

  1. Get the webservice ready that is build up using php

  2. 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

  3. 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

  4. 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/

相关文章:

php - mysql_query 返回错误,但在 phpmyadmin 中不返回错误

php - Android PHP 网络服务安全

php - Bootstrap 3 在 Symfony3 中不起作用

iphone - NSMutableData 是如何工作的?

iphone - 从 UITableView pagingEnabled 获取可见单元格

session - 在 session 中存储持久数据

php - 从php中的字符串中删除http和https

ios - 通过按钮操作进行 segue

c# - C# 中 Windows 窗体应用程序的 session

java - 如何调试部署在 jar 文件中的 stub 类?