I have a Rails app on a subdomain - xyz.domain.com, and a PHP app on another subdomain - abc.domain.com
When a user is logged into the Rails app, I would like to give them a session so that I can log certain events about that user in the PHP app but in the same database of the Rails app. I would essentially just expose an API that requires authentication.
What is the best way to go about this? I am not storing the session in a database
UPDATE I should mention that the goal is to allow authenticated access from the PHP site to the database that has been only used by the Rails app thus far. If a user is logged into the Rails app, I want to be able to track any events that occur on the PHP site and associate them with the user.