drupal_get_token

Versions
mediamosa-21
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.

▾ 10 functions call drupal_get_token()

batch_load in includes/batch.inc
Loads a batch from the database.
batch_process in includes/form.inc
Processes the batch.
dashboard_admin in modules/dashboard/dashboard.module
Dashboard page callback.
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.
drupal_process_form in includes/form.inc
Processes a form submission.
drupal_valid_token in includes/common.inc
Validate a token based on $value, the current user session and private key.
form_set_cache in includes/form.inc
Store a form in the cache.
shortcut_preprocess_page in modules/shortcut/shortcut.module
Implements hook_preprocess_page().
system_themes_page in modules/system/system.admin.inc
Menu callback; displays a listing of all themes.
update_info_page in ./update.php

Code

includes/common.inc, line 4259

<?php
function drupal_get_token($value = '') {
  $private_key = drupal_get_private_key();
  // A single md5() is vulnerable to length-extension attacks, so use it twice.
  // @todo:  add md5 and sha1 hmac functions to core.
  return md5(drupal_get_hash_salt() . md5(session_id() . $value . $private_key));
}
?>