(no commit message)
[openafs-wiki.git] / TWiki / CGISessionSerializeJsonDotPm.mdwn
1 # <a name="Package &lt;code&gt;="></a> Package =
2
3 <div>
4   <ul>
5     <li><a href="#Package =="> Package ==</a></li>
6   </ul>
7 </div>
8
9 =head1 NAME
10
11 CGI::Session::Serialize::json - serializer for CGI::Session
12
13 =head1 DESCRIPTION
14
15 This library can be used by CGI::Session to serialize session data. Requires L&lt;JSON::Syck|JSON::Syck&gt;. JSON is a type of L&lt;YAML|CGI::Session::Serialize::yaml&gt;, with one extension: serialized JSON strings are actually valid [[JavaScript]] code that a browser can execute. Any langauge that has a YAML parser (Perl, PHP, Python, Ruby, C, etc) can also read data that has been serialized with JSON.
16
17 =head1 METHODS
18
19 =over 4
20
21 =item freeze($class, \\%hash)
22
23 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&lt;set\_error()|CGI::Session::ErrorHandler/"set\_error()"&gt;
24
25 =item thaw($class, $string)
26
27 Received two arguments. First is the class name, second is the I data string. Should return thawed data structure on success, undef on failure. Error message should be set using C&lt;set\_error()|CGI::Session::ErrorHandler/"set\_error()"&gt;
28
29 =back
30
31 =head1 SEE ALSO
32
33 L&lt;CGI::Session&gt;, L&lt;JSON::Syck&gt;.