Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manage user's session on a web server for an iPhone app user [closed]

I'm writing an iPhone app. This app requires users to login on a remote web server which is using php + mysql. How can the server handle this? Using sessions? Cookies? unique IDs? Any link/code/tutorial on how to do this would be great.

Thanks!

like image 410
Hectoret Avatar asked Dec 07 '25 18:12

Hectoret


1 Answers

  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)

like image 83
Rakesh patanga Avatar answered Dec 10 '25 09:12

Rakesh patanga



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!