On Feb 9, 7:19am, Muruga [email protected] wrote:
Have you tried just making the requests subsequent times? I haven’t
used authlogic specifically, but this works for me on my iPhone app,
which uses old restful_authentication.
Usually when you do the initial login the auth system stores the user
ID in the session, and then on subsequent requests it will “log in” by
virtue of the session having the user ID. This session is (again
usually) persisted by a cookie being passed back and forth (the name
of it is set in in config/initializers/session_store.rb for my rails
2.3.x app, its the :key key of the hash sent to
ActionController::Base.session). So as long as your iPhone app
continues passing along this cookie with each subsequent request
(which from my experience it does automatically), then your app will
have the same session, which in turn has the user ID, which in turn
logs in and authenticates that person.
The caveat(s) here are to make sure that authlogic is doing the login
persistence in the session (it almost has to be if you have a web
facing app that is of any use to someone logged in), and to make sure
that the iPhone is sending the session cookie with each request.