Axl
Axl

Reputation: 87

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?

Upvotes: 0

Views: 296

Answers (2)

Álvaro González
Álvaro González

Reputation: 146540

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

Upvotes: 0

Babiker
Babiker

Reputation: 18798

This question seems to have been already addressed: Sharing a session between Ruby and PHP

Upvotes: 1

Related Questions