drupal_get_private_key

Definition

drupal_get_private_key()
includes/common.inc, line 1360

Description

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

Return value

The private key

Related topics

Namesort iconDescription
Input validationFunctions to validate user input.

Code

<?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;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.