Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

PHP::Session

by miyagawa (Chaplain)
on Mar 13, 2002 at 22:01 UTC ( [id://151534]=perlmeditation: print w/replies, xml ) Need Help??

Announcing new module: PHP::Session.

PHP::Session enables you to read / write PHP4 built-in session files (typically under /tmp/sess_*) from Perl. Then you can share your session data between Perl apps and PHP apps, which you'll never want to do :)

Tarball is here and it can be also downloaded from CPAN.

Update: 0.04 has implemented save() method.

--
Tatsuhiko Miyagawa
miyagawa@cpan.org

Replies are listed 'Best First'.
Re: PHP::Session
by jryan (Vicar) on Mar 14, 2002 at 00:27 UTC

    Awesome. A module like this has been needed for quite some time; Now people won't have to go through the hell that I went through :). I like a whole bunch of things about this module:

    1. First off, I especially like like how you interface directly with the session file, rather then trying to interface with php itself by going through multiple layers (MySQL,Apache::Session,and external scripts). Interfacing directly with the session file gives a HUGE speed boast.
    2. The functionality and Interface are top notch - especially when save is implemented.
    3. I like the design of this module as well. Extreme modularity allows for easy subclassing if the user's system configuration is whacky. Keeping the (des|s)erialization functionality in a separate module allows for scaling if the php people change the serialization.

    So, in preliminary review, PHP::Session looks to be a great module when its finished. Miyagawa++!

Re: PHP::Session
by blakem (Monsignor) on Mar 14, 2002 at 00:12 UTC
    I don't have time to dig into the source at the moment, so would you mind briefly explaining the strategy you used? Specifically how does it differ from the approach taken at Using Sessions between perl and php., which (at the time) seemed rather inefficient to me.

    -Blake

      Yep. The "right" strategy to share session between PHP and Perl is: to keep session data in RDBMS like MySQL.

      But imagine the cases where you should co-work with low-skilled PHP coders, or your company should migrate (or take over) someone else's PHP code.

      Rewriting PHP session handler (off course in PHP) is pain for Perl hackers, isn't it? So this module enables Perl coder code in Perl, PHP coders code in PHP with PHP4 builtin Session.

      --
      Tatsuhiko Miyagawa
      miyagawa@cpan.org

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://151534]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-03-29 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found