How to manually generate _Token[fields]?


#1

I’m looking into doing a form in React and I want to keep CSRF and Security with the CakePHP 3 backend.

I know I can generate the CSRF taken with by getting it with: $this->request->param(’_csrfToken’)

My problem is how is right now the backend seems to be expecteding the code $this->Form->end() generates:

        <input type="hidden" name="_Token[fields]" class="form-control" autocomplete="off" value="f422571de20dda34906e102dd053b5e5192b22ac%3Auser_id" />
        <input type="hidden" name="_Token[unlocked]" class="form-control" autocomplete="off" value="" />
        <input type="hidden" name="_Token[debug]" class="form-control" autocomplete="off" value="%5B%22%5C%2Fquestions%5C%2Fedit%5C%2F2%22%2C..." />

How do I get these values? (_Token[fields] seems to be the main one)