Persistent Sessions
PHP Driver sessions can persist
Background
- Given
- a running Cassandra cluster
- And
- a URI “status.php” with:
echo phpinfo();
No sessions have been created
- When
- I go to “/status.php”
- Then
- I should see:
A single session is re-used for all requests
- Given
- a URI “connect.php” with:
$cluster = Dse::cluster() ->withPersistentSessions(true) ->build(); $session = $cluster->connect();
- When
- I go to “/connect.php” 5 times
- When
- I go to “/status.php”
- Then
- I should see:
Multiple persistent sessions are used for requests
- Given
- a URI “connect.php” with:
$cluster = Dse::cluster() ->withPersistentSessions(true) ->build(); $session = $cluster->connect();
- And
- a URI “connect_system.php” with:
$cluster = Dse::cluster() ->withPersistentSessions(true) ->build(); $session = $cluster->connect("system");
- When
- I go to “/connect.php”
- When
- I go to “/connect_system.php”
- When
- I go to “/status.php”
- Then
- I should see:
Non-persistent sessions are recreated for each request
- Given
- a URI “connect.php” with:
$cluster = Dse::cluster() ->withPersistentSessions(false) ->build(); $session = $cluster->connect();
- When
- I go to “/connect.php”
- When
- I go to “/status.php”
- Then
- I should see: