Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rune Grønkjær 1372 posts 3103 karma points
    Sep 21, 2017 @ 08:55
    Rune Grønkjær
    0

    AntiForgeryToken and page cache

    Hi Guys,

    I have a big problem here. Umbraco Forms is using AntiForgeryToken, which ofcause is very safe, but plays bad with OutputCache, because the token isn't refreshed on each page load.

    Can I do something about it? Can I stop Umbraco Forms from using the AntiForgeryToken if nothing else works?

    I cannot just remove the token from the form.cshtml. If I do I get this server error, which is logical: The required anti-forgery form field "__RequestVerificationToken" is not present.

    Any ideas?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 22, 2017 @ 10:11
    Dennis Aaen
    100

    Hi Rune,

    Did you know that you can set the AntiForgeryToken to false.

    Try to see this documentation.

    https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Configuration/#enableantiforgerytoken

    Hope this helps,

    /Dennis

  • Rune Grønkjær 1372 posts 3103 karma points
    Sep 22, 2017 @ 11:21
    Rune Grønkjær
    0

    AAAAAH Thankyou Dennis. I knew there had to be somekind of settings for it, but could'nt find it.

    That will certainly do the trick.

    My other plan is to lazy load the forms with ajax, and see if the token works then. That will go around the page cache and might just work.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft