Skip navigation
Help

drupal_get_private_key

6 common.inc drupal_get_private_key()
7 common.inc drupal_get_private_key()

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

Return value

The private key.

4 calls to drupal_get_private_key()

File

drupal/includes/common.inc, line 4856
Common functions that many Drupal modules will need to reference.

Code

function drupal_get_private_key() {
  if (!($key = variable_get('drupal_private_key', 0))) {
    $key = drupal_hash_base64(drupal_random_bytes(55));
    variable_set('drupal_private_key', $key);
  }
  return $key;
}