From: Lee on
Hi, I wanted to know how to use PHP sessioning with Perl.

In short, I am using sessioning to keep track of particular variables
between SOAP calls. The SOAP server is being run with PHP and cannot
be changed to another language because of the PHP infrastructure that
has already been built. When I use a PHP client, it remembers the
variables. When I use SOAP::Lite, it does not remember the session
variables. How can I make Perl interface with PHP's sessioning?
Thank you for any help.

My problem is detailed very well on the PHP forum at
http://groups.google.com/group/comp.lang.php/browse_thread/thread/7657d5bf882f287b
From: RedGrittyBrick on
On 14/04/2010 23:04, Lee wrote:
> Hi, I wanted to know how to use PHP sessioning with Perl.
>
> In short, I am using sessioning to keep track of particular variables
> between SOAP calls. The SOAP server is being run with PHP and cannot
> be changed to another language because of the PHP infrastructure that
> has already been built. When I use a PHP client, it remembers the
> variables. When I use SOAP::Lite, it does not remember the session
> variables. How can I make Perl interface with PHP's sessioning?
> Thank you for any help.

My guess is that you need your Perl client to preserve and regurgitate
cookies

http://cookbook.soaplite.com/#using%20cookies

> My problem is detailed very well on the PHP forum at
> http://groups.google.com/group/comp.lang.php/browse_thread/thread/7657d5bf882f287b

I don't plan on joining a PHP newsgroup - sorry.

--
RGB
From: Sherm Pendley on
Lee <lskatz(a)gmail.com> writes:

> When I use SOAP::Lite, it does not remember the session
> variables. How can I make Perl interface with PHP's sessioning?

Do PHP's sessions use cookies? If so, you might try adding a cookie jar
to track them:

<http://cookbook.soaplite.com/#using%20cookies>

sherm--
From: Lee on
Cookies was exactly right, thank you. Here is the solution that
worked.

use strict;
use warnings;
use Data::Dumper;
use HTTP::Cookies;
use SOAP::Lite;# on_debug => sub{print@_};

my($response,$value);

my $cookieFile="./cookie.txt";
my $cookie=HTTP::Cookies->new(ignore_discard=>1,file=>
$cookieFile,autosave=>1);

my $soap = SOAP::Lite
-> uri('http://mgip2.biology.gatech.edu')
-> proxy('http://mgip2.biology.gatech.edu/api/apiServer4.php')
;
$soap->transport->cookie_jar($cookie);