function drupal_get_private_key in Drupal 5
Same name and namespace in other branches
- 4 includes/common.inc \drupal_get_private_key()
- 6 includes/common.inc \drupal_get_private_key()
- 7 includes/common.inc \drupal_get_private_key()
Ensure the private key variable used to generate tokens is set.
Return value
The private key
Related topics
1 call to drupal_get_private_key()
- drupal_get_token in includes/
common.inc - Generate a token based on $value, the current user session and private key.
File
- includes/
common.inc, line 1918 - 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 = md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true));
variable_set('drupal_private_key', $key);
}
return $key;
}