drupal_get_private_key

  1. drupal
    1. 4.7
    2. 5
    3. 6 common.inc
    4. 7 common.inc
Versions
4.7 – 7 drupal_get_private_key()

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

Return value

The private key

Related topics

▾ 1 function calls drupal_get_private_key()

drupal_get_token in includes/common.inc
Generate a token based on $value, the current user session and private key.

Code

includes/common.inc, line 1361

<?php
function drupal_get_private_key() {
  if (!($key = variable_get('drupal_private_key', 0))) {
    $key = mt_rand();
    variable_set('drupal_private_key', $key);
  }
  return $key;
}
?>