get('session'); // Do the real work of hooking up Dynamo as session handler $dynamoDb = DynamoDbClient::factory(array( 'credentials' => array( 'key' => _env('DYNAMO_KEY'), 'secret' => _env('DYNAMO_SECRET'), ), 'region' => _env('DYNAMO_REGION'), 'version' => '2012-08-10' )); $sessionHandler = $dynamoDb->registerSessionHandler([ 'table_name' => $cfg['table'], 'hash_key' => 'id', 'session_lifetime' => 60 * $cfg['lifetime'], // minutes to seconds 'consistent_read' => true, 'locking_strategy' => null, 'automatic_gc' => true, 'gc_batch_size' => 25, 'max_lock_wait_time' => 10, 'min_lock_retry_microtime' => 10000, 'max_lock_retry_microtime' => 50000 ]); // Set the start of the session id to the cookie name - optional $sessionHandler->open('', $cfg['cookie']); return $sessionHandler; }); } }