4.6.x common.inc drupal_get_token($value = '')
4.7.x common.inc drupal_get_token($value = '')
5.x common.inc drupal_get_token($value = '')
6.x common.inc drupal_get_token($value = '')
7.x common.inc drupal_get_token($value = '')

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

2 calls to drupal_get_token()
drupal_prepare_form in includes/form.inc
Prepares a structured form array by adding required elements, executing any hook_form_alter functions, and optionally inserting a validation token to prevent tampering.
update_info_page in ./update.php

File

includes/common.inc, line 1932
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);
}