Lee Wang
Lee Wang

Reputation: 81

Perl's CGI::Session doesn't seem to find existing session (from PHP)

I'm trying to instantiate a CGI::Session object from a session created in a separate PHP script; however, when I Dumper() the object, I see that the _CLAIMED_ID session id (which matches the PHP's session_id()) is different from the _SESS_ID (or whatever) stored in the _DATA member; more to the point, the _DATA member doesn't have any of the session variables that I registered in PHP.

HOWEVER! When I use PHP::Session (and passing the same sess id to its constructor), THIS object does indeed find the session variables in question.

Ideally, I want to use CGI::Session since it seems to be more robust and PHP::Session seems to be a lot more task-specific, so can someone suggest where I'm going wrong with CGI::Session? (Should I create a PHP::Session and then try to pass it to CGI::Session?)

Upvotes: 1

Views: 388

Answers (1)

cjm
cjm

Reputation: 62099

PHP::Session was designed to interoperate with sessions created in PHP. CGI::Session was designed as a Perl-only solution.

CGI::Session does offer multiple back-end implementations, so in theory somebody could write driver, serializer, and id modules for CGI::Session that would be compatible with PHP sessions. Nobody seems to have done that yet, though.

Upvotes: 5

Related Questions