Prev: FAQ 4.3 Why isn't my octal data interpreted correctly?
Next: FAQ 5.26 How do I get a file's timestamp in perl?
From: Lee on 14 Apr 2010 18:04 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 15 Apr 2010 11:07 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 15 Apr 2010 14:06 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 20 Apr 2010 14:54
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); |