public function close()
{
if (!$this->_session_written)
{
// Ensure that the session is unlocked even if the write did not happen
$id = $this->_open_session;
$response = $this->_dynamodb->update_item(array(
'TableName' => $this->_table_name,
'Key' => array('HashKeyElement' => $this->_dynamodb->attribute($this->_id($id))),
'AttributeUpdates' => array(
'expires' => $this->_dynamodb->attribute(time() + $this->_session_lifetime, 'update'),
'lock' => array('Action' => AmazonDynamoDB::ACTION_DELETE)
),
));
$this->_session_written = $response->isOK();
}
$this->_open_session = null;
return $this->_session_written;
}