function drupal_get_private_key
Ensures the private key variable used to generate tokens is set.
Return value
The private key.
3 calls to drupal_get_private_key()
- drupal_get_token in includes/
common.inc - Generates a token based on $value, the user session, and the private key.
- image_style_path_token in modules/
image/ image.module - Generates a token to protect an image style derivative.
- _update_process_fetch_task in modules/
update/ update.fetch.inc - Processes a task to fetch available update data for a single project.
File
-
includes/
common.inc, line 5332
Code
function drupal_get_private_key() {
if (!$key = variable_get('drupal_private_key', 0)) {
$key = drupal_random_key();
variable_set('drupal_private_key', $key);
}
return $key;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.