# man > Apache::Session::Flex

---
type: CommandReference
command: Apache::Session::Flex
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference
- `tie %hash, 'Apache::Session::Flex', $id, { Store => 'DB_File', Lock => 'Null', Generate => 'MD5', Serialize => 'Storable' }` — Use DB_File store, no locking, MD5 IDs, Storable serialization
- `tie %hash, 'Apache::Session::Flex', $id, { Store => 'Postgres', Lock => 'Null', Generate => 'MD5', Serialize => 'Base64' }` — Use Postgres store, no locking, MD5 IDs, Base64 serialization

## Name
Apache::Session::Flex - Specify everything at runtime

## Synopsis
perl
use Apache::Session::Flex;

tie %hash, 'Apache::Session::Flex', $id, {
   Store     => 'DB_File',
   Lock      => 'Null',
   Generate  => 'MD5',
   Serialize => 'Storable'
};

# or

tie %hash, 'Apache::Session::Flex', $id, {
   Store     => 'Postgres',
   Lock      => 'Null',
   Generate  => 'MD5',
   Serialize => 'Base64'
};
## Options
The constructor accepts a hash reference with four keys, each specifying the module to use for that role. The full module name is constructed by appending the role and value to `Apache::Session::`. For example, `Store => 'MySQL'` uses `Apache::Session::Store::MySQL`.

- `Store` — Backing store module. Options: `MySQL`, `Postgres`, `DB_File`, `File`
- `Lock` — Locking scheme module. Options: `Null`, `MySQL`, `Semaphore`
- `Generate` — ID generation module. Options: `MD5`
- `Serialize` — Data serialization module. Options: `Storable`, `Base64`, `UUEncode`

Additional arguments required by the chosen Store and Lock modules must be provided in the same hash reference.

## Examples
See Synopsis above.

## See Also
- [Apache::Session::File](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AFile/markdown)
- [Apache::Session::DB_File](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession%3A%3ADBFile/markdown)
- [Apache::Session::MySQL](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AMySQL/markdown)
- [Apache::Session::Postgres](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession%3A%3APostgres/markdown)
- [Apache::Session](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession/markdown)