basic rails login API for iOS
<p>I would like to authenticate users and persist their sessions for an iOS app using a rails backend. The server where the rails app lives expects HTTPS. My current thought process for the auth/persistence process is the user submits login info from the iOS app, which is passed to our server, the server replies with a cookie containing the user's ID, which the iOS app saves in the keychain. Then, in subsequent requests, the iOS app sends the cookie in the request, from which the rails app can extract the user and thereby persist it. (For what it is worth, we don't store passwords locally. They are actually authenticated against another internal API).</p>

<p>I have little doubt there are problems with this, but I'd like to know what those problems are and how they could come about. </p>