Is it possible to access php $_SESSION variables in a cgi/ruby script?
Title pretty much speaks for itself. Is there a simple way to do this? I was thinking of just writing the data stored in the session variable to a temp file then having the ruby script read the data from the file,开发者_高级运维 but that seems kind of dumb. Is there a better way to do this?
This question seems to have been already addressed: Sharing a session between Ruby and PHP
IMHO, the cleanest mechanism would be to write a custom PHP session handler that:
- Stores data to a database (rather than files)
- Serializes data to a format known by Ruby, possibly JSON
精彩评论