Hi Mikko, thank you for your reply :) I don't think I'm doing anything weird there. The problem happens in a class-based view. I can see the 'csrf_token' cookie qith the right value, I can display the same value inside a template by calling get_csrf_token(), but the value generated inside the deferred function is different, although being passed (I think) the same request object...
Le mer. 28 avr. 2021 à 19:39, Mikko Ohtamaa <[email protected]> a écrit : > > Hi Laurent, > >> >> >> The Deform Demo >> (https://deformdemo.pylonsproject.org/pyramid_csrf_demo/) shows how to >> use a deferred value to create hidden field "csrf_token" in the >> generated forms > > >> >> >> But there's a problem: the token generated that way doesn't have the >> same value as when I directly call get_csrf_token() in a template. > > > Usually, this value is tied to the user session. Out of my head, without > inspecting the code, I would suspect issues with, or mishandling of, cookies, > sessions and such. > > Br, > Mikko > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUuVJAJ6rAOrgmQ0W%2Bu_RVfo598oWU%3D5U_k-4JrvtOM7Cg%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAB7cU6z%3DfZvYd-r9SV25gMwcaosUimJUMO-Snm2yv5uP01iENw%40mail.gmail.com.
