data/TWiki/CGISessionSerializeYamlDotPm.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 ---+ Package ==
     2 
     3 %TOC%
     4 =head1 NAME
     5 
     6 CGI::Session::Serialize::yaml - serializer for CGI::Session
     7 
     8 =head1 DESCRIPTION
     9 
    10 This library can be used by CGI::Session to serialize session data. It uses
    11 L<YAML|YAML>, or the faster C implementation, L<YAML::Syck|YAML::Syck>
    12 if it is available. YAML serializers exist not just for Perl but also other
    13 dynamic languages, such as PHP, Python, and Ruby, so storing session data
    14 in this format makes it easy to share session data across different languages.
    15 
    16 YAML is made to be friendly for humans to parse as well as other computer
    17 languages. It creates a format that is easier to read than the default
    18 serializer.
    19 
    20 =head1 METHODS
    21 
    22 =over 4
    23 
    24 =item freeze($class, \%hash)
    25 
    26 Receives two arguments. First is the class name, the second is the data to be serialized. Should return serialized string on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
    27 
    28 =item thaw($class, $string)
    29 
    30 Received two arguments. First is the class name, second is the I<YAML> data string. Should return thawed data structure on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
    31 
    32 =back
    33 
    34 =head1 SEE ALSO
    35 
    36 L<CGI::Session>, L<YAML>, L<YAML::Syck>.
    37