I’m working on a session handler for PHP using the php-pecl-couchbase2 package, SDK version 2.0.6
I have a problem setting expiration of documents when calling the upsert() function. If I supply the expiration as a number, then it goes into Couchbase, but PHP throws error : Options argument must be an associative array.
When supplying as an associative array then no error, but the expiration gets set to 0.
This sets the lifetime correctly in the Couchbase bucket, but PHP throws: Options argument must be an associative array.
$this->_bucket->upsert($sessionID,$json_data, array(‘expiration’ => 100));
This does not throw error, but it does not set the expiration date in the Couchbase bucket - or actually sets it to the default 0.
I have looked at the documentation but did not see anywhere what should be the proper way of settings expiration.
Also, another question re expiration: how to read the expiration of a document?