1.20.x common.inc backdrop_get_private_key()

Ensures the private key variable used to generate tokens is set.

Return value

The private key.:

File

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

Code

function backdrop_get_private_key() {
  if (!($key = state_get('private_key'))) {
    $key = backdrop_random_key();
    state_set('private_key', $key);
  }
  return $key;
}