Installation guide
SignalWorkflowExecution StartWorkflowExecution
TerminateWorkflowExecution
DynamoDB Session Handler
Introduction
The DynamoDB Session Handler is a custom session handler for PHP that allows developers to use Amazon
DynamoDB as a session store. Using DynamoDB for session storage alleviates issues that occur with session
handling in a distributed web application by moving sessions off of the local file system and into a shared location.
DynamoDB is fast, scalable, easy to setup, and handles replication of your data automatically.
The DynamoDB Session Handler uses the session_set_save_handler() function to hook DynamoDB
operations into PHP's native session functions to allow for a true drop in replacement. This includes support for
features like session locking and garbage collection which are a part of PHP's default session handler.
For more information on the Amazon DynamoDB service, please visit the Amazon DynamoDB homepage.
Basic Usage
1. Register the handler
The first step is to instantiate the Amazon DynamoDB client and register the session handler.
require 'vendor/autoload.php';
use Aws\DynamoDb\DynamoDbClient;
$dynamoDb = DynamoDbClient::factory(array(
'key' => '<aws access key>',
'secret' => '<aws secret key>',
'region' => '<region name>'
));
$sessionHandler = $dynamoDb->registerSessionHandler(array(
'table_name' => 'sessions'
));
You can also instantiate the SessionHandler object directly using it's factory method.
require 'vendor/autoload.php';
use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\Session\SessionHandler;
$dynamoDb = DynamoDbClient::factory(array(
'key' => '<aws access key>',
'secret' => '<aws secret key>',
'region' => '<region name>',
));
$sessionHandler = SessionHandler::factory(array(
'dynamodb_client' => $dynamoDb,
'table_name' => 'sessions',
));
$sessionHandler->register();
2. Create a table for storing your sessions
DynamoDB Session Handler
127