Same name and namespace in other branches
  1. 4.6.x includes/common.inc \drupal_get_token()
  2. 5.x includes/common.inc \drupal_get_token()
  3. 6.x includes/common.inc \drupal_get_token()
  4. 7.x includes/common.inc \drupal_get_token()

Generate a token based on $value, the current user session and private key.

Parameters

$value: An additional value to base the token on

Related topics

File

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

Code

function drupal_get_token($value = '') {
  $private_key = drupal_get_private_key();
  return md5(session_id() . $value . $private_key);
}