Ask your Symfony questions! Pay money and get answers fast! (more info)

Where do I find the current CSRF value? Symfony

  • SOLVED

Symfony 1.4 using Propel.

The default login form for sfGuardUser will produce something like this:

<input type="hidden" name="signin[_csrf_token]" value="96861c5f7c3dca8e9c0e169700c764ed" id="signin__csrf_token" />


My client wants a complicated, highly detailed custom login screen. Their designer built out the mockup of this form using Dreamweaver, and the form is rich with CSS, HTML, and Javascript. So I have overriden the default sfGuardAuth module and I copy and pasted the clients CSS/HTML/Javascript to the form.

Now I need to copy over the fields that sfGuardUser needs. This is easy, except for the CSRF field. I can not find where that value is stored. It does not appear to be a field inside of the form. I tried:

<?php echo $form['_csrf_token'] ?>

but that did not work. So where do I find this value?

Answers (1)

2012-12-07

mullerivan answers:

easy

$form->renderHiddenFields()