Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Keep It Simple, Stupid
 
PerlMonks

Maintaining PHP session in PERL

by lamp (Chaplain)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on Feb 10, 2005 at 09:59 UTC ( #429647=perlquestion: print w/ replies, xml ) Need Help??
lamp has asked for the wisdom of the Perl Monks concerning the following question:

We are developing an application which will interact with another php application.
There we need to maintain the session of php application in our perl application.
From cpan.org, i got information about PHP::Session which is used
to maintain Perl application session shared with PHP.
Can anybody share some information on this module and other implementation options?

Thanks.

Comment on Maintaining PHP session in PERL
Re: Maintaining PHP session in PERL
by dpavlin (Pilgrim) on Feb 10, 2005 at 13:44 UTC
    It's quite simple:
    #!/usr/bin/perl -w use strict; use PHP::Session; use CGI::Lite; use Data::Dumper; my $session_name = 'PHPSESSID'; # change this if needed print "Content-type: text/plain\n\n"; my $cgi = new CGI::Lite; my $cookies = $cgi->parse_cookies; if ($cookies->{$session_name}) { my $session = PHP::Session->new($cookies->{$session_name}); # now, try to dump _s_pod variable from session print "_s_pod:",Dumper($session->get('_s_pod')); } else { print "can't find session cookie $session_name"; }
    Disclamer: I'm still not using PHP::Session in production, but this seem to work good enough for me.
    Hum, should this example should go into module documentation?

    2share!2flame...
[reply]
[d/l]

Back to Seekers of Perl Wisdom


Login:
Password
remember me
What's my password?
Create A New User

Node Status
node history
Node Type: perlquestion [id://429647]
Approved by fireartist
help
Community Ads
Chatterbox
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users
Others surveying the Monastery: (12)
ikegami
GrandFather
jdporter
Your Mother
atcroft
herveus
thezip
Eyck
MonkE
ssandv
gnosti
wanradt
As of 2009-11-21 04:18 GMT
Sections
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth

Future historians will find that the material characteristic of the current era is...

Aluminium
Plastic
Oil
Water
Carbon dioxide
Copper
Iron
Silicon
Salt
Uranium
Hydrogen
Other

Results (726 votes), past polls