in reply to Re: Re: Re: Using Sessions between perl and php.
in thread Using Sessions between perl and php.

While a method like this is pretty commonly used in home rolled session systems (and works well enough), there is something that Apache::Session allows you to do via using Storable that you can't do with this mechanism.

Arbitrary data structures.

What happens when the session information I need to store goes beyond simple key value pairs? What if I have something like:

# assume $session is via Apache::Session $session->{'email_targets'} = { "john@doe.com" => { 'first_name' => 'John', 'last_name' => 'Doe' }, "jane@doe.com" => { 'first_name' => 'Jane', 'last_name' => 'Doe' } };

HTH

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Replies are listed 'Best First'.
Re^5: Using Sessions between perl and php.
by Aristotle (Chancellor) on Jan 21, 2002 at 03:49 UTC

    Accepted - the fact that Apache::Session uses Storable to store deep structures is a stumbling block of course. However what is the benefit? In the What are some things to remember? section your document says:

    Only use a single level associative array or hash. Do not try to use multiple levels in PHP, such as $session['username'][1], or use references in Perl, as in $session{username}[2]. Only store numerical and string data in session variables.

    Makeshifts last the longest.

Re: (maverick) Re 4: Using Sessions between perl and php.
by jryan (Vicar) on Jan 21, 2002 at 06:31 UTC
    That is only when using sessions between php and perl. For web applications that use only perl, there is no need to worry about it, and the full power of Storable can be unleased.