# man > CGI::Session::Serialize::storable

---
type: CommandReference
command: CGI::Session::Serialize::storable
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference
- `use CGI::Session::Serialize::storable` — Use Storable as the serializer for CGI::Session
- `$serialized = CGI::Session::Serialize::storable->freeze($class, \%hash)` — Serialize session data hash to a string
- `$hashref = CGI::Session::Serialize::storable->thaw($class, $string)` — Deserialize a frozen string back to a hash

## Name
CGI::Session::Serialize::storable — Serializer for CGI::Session using Storable

## Synopsis
perl
use CGI::Session;
use CGI::Session::Serialize::storable;

my $session = CGI::Session->new('driver:file', undef, { Serializer => 'storable' });
# or explicitly:
# $session->serializer('CGI::Session::Serialize::storable');
## Options
- `freeze($class, \%hash)` — Receives class name and a hash reference of session data. Returns serialized string on success, `undef` on failure. On failure, error message is set via `set_error()`.
- `thaw($class, $string)` — Receives class name and a frozen data string. Returns thawed data structure (hash reference) on success, `undef` on failure. On failure, error message is set via `set_error()`.

## Examples
perl
use CGI::Session::Serialize::storable;

my $data = { user => 'alice', score => 42 };
my $frozen = CGI::Session::Serialize::storable->freeze('CGI::Session', $data);
my $thawed = CGI::Session::Serialize::storable->thaw('CGI::Session', $frozen);
# $thawed is now a reference to the original hash
## See Also
- [CGI::Session](http://localhost/phpMan.php/perldoc/CGI%3A%3ASession/markdown) — Session management
- [CGI::Session::ErrorHandler](http://localhost/phpMan.php/perldoc/CGI%3A%3ASession%3A%3AErrorHandler/markdown) — Error handling base class
- [Storable](http://localhost/phpMan.php/man/storable/3pm/markdown) — Persistence for Perl data structures

## Exit Codes
Not applicable.