1 common.inc tempstore_set($collection, $name, $value, $expire)

Stores an object in the semi-persistent key-value store.


string $collection: A string defining the collection or group indicator. Must be less than 128 characters.

string $name: The name of the object being stored. Must be less than 128 characters.

array|object $value: The data to be stored. This will be serialized prior to writing.

int $expire: The UNIX timestamp at which this value can be deleted.

Related topics


core/includes/common.inc, line 1655
Common functions that many Backdrop modules will need to reference.


function tempstore_set($collection, $name, $value, $expire) {
  tempstore_clear($collection, $name);
      'collection' => $collection,
      'name' => $name,
      'value' => serialize($value),
      'expire' => $expire,