You are here

public function AuthcacheFormTokenFragment::render in Authenticated User Page Caching (Authcache) 7.2

Render hidden field for CSRF token.

Overrides AuthcacheP13nFragmentInterface::render

File

modules/authcache_form/includes/AuthcacheFormTokenFragment.inc, line 16
Personalized fragment for CSRF tokens.

Class

AuthcacheFormTokenFragment
Retrieve CSRF-form token for the logged in user.

Code

public function render($form_token_id, $ignored, $context) {
  include_once DRUPAL_ROOT . '/includes/common.inc';
  $form_token = drupal_get_token($form_token_id);
  return format_string('<input type="hidden" name="form_token" value="@form_token"></input>', array(
    '@form_token' => $form_token,
  ));
}