M
M
metallix2019-06-03 20:39:22
PHP
metallix, 2019-06-03 20:39:22

What is the problem with AWS SessionHandler?

Greetings!
There is an application on Phalcon framework. Sessions are stored using 'DynamoDB' and `SessionHandler` from AWS.
Code -

$di['session'] = function () {
    $config = $this->getShared('config');

    if(ENV != 'local'){
        $credentials = new \Aws\Credentials\Credentials($config->amazon->AWSAccessKeyId, $config->amazon->AWSSecretKey);

        $dynamoDb = new DynamoDbClient([
            'credentials' => $credentials,
            'region' => $config->amazon->Region,
            'version' => 'latest',
        ]);

        $sessionHandler = SessionHandler::fromClient($dynamoDb,[
            'table_name'    => $config->amazon->sessionTable
        ]);

        $sessionHandler->register();
    }

    $session = new Phalcon\Session\Adapter\Files();
    $session->start();

    return $session;
};

Problem -
Appeared after updating php from 5.6 to 7.2 and AWS SDK from 2.8 to 3.9
In the local environment, everything works fine, but when rolled out to the test environment, the session initialization falls off.
At the time of execution - the $session->start();
page falls off with a 503 error (Gateway Time-Out).
PHP Version - 7.2.18
Phalcon: -3.4.4
AWS SDK - 3.98.
phpinfo() local
5cf55a65e01a0362386755.png
phpinfo() test environment
5cf55a92efcbb796430232.png

only in the test environment the value `session.save_handler` = user. But even after changing to files, nothing worked.
PS I do not have access to the logs, only deploy through the repository
I would be grateful for any help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question