Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
118 views
in Technique[技术] by (71.8m points)

How to retrieve PHP session in Perl file?

I tried with CGI::Session and PHP::Session to retrieve PHP sessions in Perl but no luck still. Could you anyone help out me to resolve that task? using Core PHP for session.

use CGI::Session;
use PHP::Session;
my $session = PHP::Session->new($sid, { auto_save => 1 });
$session->set(foo => 'bar');
my $cgi = new CGI;
my $sid = $cgi->param("sid") || undef;
my $session = new CGI::Session::File($sid,
{
LockDirectory=>"/tmp/sessions",
Directory    => "/tmp/sessions"
});
# get the session id...
my $sid = $session->id();
print $session;

Also getting errors "Can't locate PHP/Session.pm in @INC (you may need to install the PHP::Session module)" but already installed by these cli perl -MCPAN -e shell + install Session

question from:https://stackoverflow.com/questions/65840473/how-to-retrieve-php-session-in-perl-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...