I have a PHP application that is highly session dependent. Now we are considering creating an API for our users. Our initial thoughts are that users need to authenticate against api with their email address, password and API key (unique to each user).
However, since the current application (including models) makes extensive use of user sessions, I am not sure of the best approach.
Assuming the API request is authenticated correctly, it would be acceptable:
- Starting a session to call the API after user authentication
- Run models and return json / xml to user
- Kill the session
This means that a session is created for each API call, and then immediately cleared. This is normal? Or should we consider other alternatives?
Jonob
source share