Subject: | Re: Question about PHP::Session |
Date: | Thu, 15 Oct 2009 10:55:31 -0700 |
To: | Age Tats <age.tats [...] ut.ee>, bug-PHP-Session [...] rt.cpan.org |
From: | Tatsuhiko Miyagawa <miyagawa [...] gmail.com> |
Sorry I have no idea what's going around, but it looks like your
session files are encrypted. Again I've never used this module with
recent PHP and have absolutely no idea what's wrong. I pass this
module to the bug queue and let other maintainers know about this.
On Thu, Oct 15, 2009 at 2:07 AM, Age Tats <age.tats@ut.ee> wrote:
Show quoted text
> Hello,
>
> I have faced a problem with passing php session variables to perl script.
> Situation is as follows:
> We have password protected web page using php sessions and allowing users to
> access different parts of the page depending on the user level they have.
> Now I have a separately located program implemented in perl, which should
> also be password protected and use the same user level information as php
> page. So I have to transfer level information to this perl script.
>
> After long experiments and searches I ended up with your PHP::Session
> module, which should do exactly what I need. I have set the php
> session.save_path to /tmp because there are cgi session files. So this works
> fine.
> The script I tested:
>
> use CGI::Lite;
> use PHP::Session;
> use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
>
> my $session_name = 'PHPSESSID';
> my $cgi = new CGI::Lite;
> my $cookies = $cgi->parse_cookies;
>
> if ($cookies->{$session_name}){
> my $session = PHP::Session->new($cookies->{$session_name});
> $level = $session->get('level');
> open LOG, ">log.txt";
> print LOG "level: $level";
> }
>
> However, I get following error:
>
> weird data:
> HlR_pmzkpLl0wBtP0XBOgWXhYbATowqizGEJEhpZKAKhPs6Ks0xecsAF5ovPuf1vIAlrHjpfZ6zDnoI29evPIgVkNF5TKDTV9_kUoR3TZMQAQXTPAl1pxSYvWnmW88c-X5Wn1Vh8DzXt2PmSrnzA-vqKFhvvZA4QNFRmQ0yeN1Y.
> at /usr/lib/perl5/site_perl/5.8.8/PHP/Session/Serializer/PHP.pm line 222
>
> When I wrote php session variables into textfile using session_encode() to
> check the content, everything looked normal.
>
> session.serialize_handler is php in php.ini.
> Could it be version problem? We are using PHP 5.2.1. Though, when searching
> the forums I found that with PHP5 it works.
>
> Maybe you have heard or faced similar problems and could suggest something?
>
> I would really appreciate it!
>
> With best regards
> Age Tats
> University of Tartu, Estonia
> http://bioinfo.ut.ee
>
--
Tatsuhiko Miyagawa