# perldoc > CGI::Session::Serialize::freezethaw

---
type: CommandReference
command: CGI::Session::Serialize::freezethaw
mode: perldoc
section:
source: perldoc
---

## Quick Reference

- `freeze($class, $data)` — serialize session data using FreezeThaw, returns serialized string on success, undef on failure
- `thaw($class, $frozen)` — deserialize frozen data, returns data structure on success, undef on failure

## Name

serializer for [CGI::Session](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession/markdown)

## Synopsis

Used internally by [CGI::Session](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession/markdown) to serialize session data. Specify `freezethaw` as the serializer driver when creating a session object.

## Options

- `freeze` — receives two arguments: class name and data to serialize. Returns serialized string on success, undef on failure. Set error message using `set_error()` from [CGI::Session::ErrorHandler](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession%3A%3AErrorHandler/markdown)
- `thaw` — receives two arguments: class name and frozen data string. Returns thawed data structure on success, undef on failure. Set error message using `set_error()` from [CGI::Session::ErrorHandler](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession%3A%3AErrorHandler/markdown)

## See Also

- [CGI::Session](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession/markdown) — session management module
- [CGI::Session::ErrorHandler](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3ASession%3A%3AErrorHandler/markdown) — error handling base class
- FreezeThaw — the serialization library used