Generate a form token based on the session and the private key to defend against cross site request forgeries.

Related topics

3 calls to form_token()
comment_render in modules/comment.module
form in includes/common.inc
Generate a form from a set of form elements.
xtemplate_page in themes/engines/xtemplate/xtemplate.engine

File

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

Code

function form_token() {
  return form_hidden('token', drupal_get_token());
}