I want to exclude "data" field because my session data are large than 1500 bytes and I get an error while writing session. Is there another way without changing library code?
public function write($id, $data)
{
try {
$key = $this->datastore->key(
$this->kind,
$id,
['namespaceId' => $this->namespaceId]
);
$entity = $this->datastore->entity(
$key,
[
'data' => $data,
't' => time()
],
[
'excludeFromIndexes' => ['data'] // I want to pass it
]
);
$this->transaction->upsert($entity);
$this->transaction->commit();
} catch (Exception $e) {
trigger_error(
sprintf('Datastore upsert failed: %s', $e->getMessage()),
E_USER_WARNING
);
return false;
}
return true;
}
I want to exclude "data" field because my session data are large than 1500 bytes and I get an error while writing session. Is there another way without changing library code?
Google\Cloud\Datastore\DatastoreSessionHandler