write ( $id, $data )

Write a session to DynamoDB.

Part of the standard PHP session handler interface.

Access

public

Parameters

Parameter

Type

Required

Description

$id

string

Required

The session ID.

$data

string

Required

The session data.

Returns

Type

Description

boolean

Whether or not the operation succeeded.

Source

Method defined in extensions/dynamodbsessionhandler.class.php | Toggle source view (16 lines) | View on GitHub

public function write($id, $data)
{
    // Write the session data to DynamoDB
    $response = $this->_dynamodb->put_item(array(
        'TableName' => $this->_table_name,
        'Item'      => $this->_dynamodb->attributes(array(
            $this->_hash_key => $this->_id($id),
            'expires'        => time() + $this->_session_lifetime,
            'data'           => $data,
        )),
    ));

    $this->_session_written = $response->isOK();

    return $this->_session_written;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback