NAME

CGI::Session::Serialize::php - PHP serializer for CGI::Session

DESCRIPTION

This library can be used by CGI::Session to serialize session data. It is a wrapper around the PHP::Session::Serializer::PHP. Use of this serializer allows common session data storage when writing Web Applications in both Perl and PHP. NOTE: you will need to store the Session ID in your PHP session data structure as $_SESSION['_SESSION_ID'] = session_id(); as the return from the thaw() method is checked for it's existance. CGI::Session will croak with the error "Invalid data structure returned from thaw()" if it is not seen. Be careful storing arrays as arrays look like hashes once serialized and deserialized. You will need extra logic to convert them back to arrays again. Don't forget to add 'serializer:php' to your CGI::Session initialization string.

METHODS

freeze($class, \%session_data_hash)

Receives two arguments. First is the class name, the second is the session data to be serialized. Should return serialized string on success, undef on failure. Error message should be set using set_error()|CGI::Session::ErrorHandler/"set_error()"

thaw($class, $php_serialized_string)

Receives two arguments. First is the class name, second is the PHP serialized data string. Should return deserialized session data structure on success, undef on failure. Error message should be set using set_error()|CGI::Session::ErrorHandler/"set_error()"

SEE ALSO

CGI::Session, PHP::Session::Serializer::PHP.