drupal_get_token

Versions
4.6 – 7
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

▾ 1 function calls drupal_get_token()

form_token in includes/common.inc
Generate a form token based on the session and the private key to defend against cross site request forgeries.

Code

includes/common.inc, line 947

<?php
function drupal_get_token($value = '') {
  $private_key = drupal_get_private_key();
  return md5(session_id() . $value . $private_key);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.