Error: The required anti-forgery cookie "__RequestVerificationToken" is not present.
Any idea, suggestion? I also have a membership login page before my website. It somehow connects, because without the login restriction everything is fine, even with debug=true value.
It was a surface controller but i already find the solution. In my case i had a CachedPartial with my login modal and when i change it to renderPartial this problem disapear.
I'm getting this error on Umbraco 8 as well (8.11 and 8.12)
debug true or false for compilation - same thing
__RequestVerificationToken is being passed through in the query paramenters and if I comment out [ValidateAntiForgeryToken] in the SurfaceController action it works fine... but that's not ideal.
Are you caching the rendering of the form somehow ? If so, than the verification token will be cached as well. Verification tokens have a limited lifetime.
I've also created a test c# mvc project on 4.7.2 as well and that works fine.
I copied over as much of the web.config as I could from Umbraco too.
These views and controllers are essentially the same as working Umbraco 7 versions that have been moved over to Umbraco 8 projects which all have this issue.
Thanks Dave - me too! It's got me stuffed..
Yes, the __RequestVerificationToken is definitely there in the form elements in the front-end and it's being posted in the request parameters.
The required anti-forgery cookie "__RequestVerificationToken" is not present.
Hi,
When debug is false in web.config I get this message on my website.
Error: The required anti-forgery cookie "__RequestVerificationToken" is not present.
Any idea, suggestion? I also have a membership login page before my website. It somehow connects, because without the login restriction everything is fine, even with debug=true value.
Hi Levente,
I'm facing this problem. Did you solve this?
Regards
Are you trying to submit a form or call a surface controller action? What is the context of this issue exactly and when does this popup?
Thanks Levente,
It was a surface controller but i already find the solution. In my case i had a CachedPartial with my login modal and when i change it to renderPartial this problem disapear.
I'm getting this error on Umbraco 8 as well (8.11 and 8.12) debug true or false for compilation - same thing
__RequestVerificationToken is being passed through in the query paramenters and if I comment out [ValidateAntiForgeryToken] in the SurfaceController action it works fine... but that's not ideal.
Has anyone had any luck with this one?
Hi Warren,
Are you caching the rendering of the form somehow ? If so, than the verification token will be cached as well. Verification tokens have a limited lifetime.
Dave
Thanks Dave and no, there's no cache at all - the form is directly in the Umbraco View Page.
Hi Warren,
I just saw you mentioned query parameters. Are you sending the form with a POST or a GET request ?
Dave
something like this:
I've also created a test c# mvc project on 4.7.2 as well and that works fine. I copied over as much of the web.config as I could from Umbraco too.
These views and controllers are essentially the same as working Umbraco 7 versions that have been moved over to Umbraco 8 projects which all have this issue.
Hi Warren,
Are you running your website under https or not ?
That could problems with this config setting in the web.config
If that is set to true, and you are not running SSL than you have issues. And probably the other way around as well.
Dave
Thanks again - yep I have that... actually here's most of the relevant parts of the web.config
Hi Warren,
Could you disable the rewrite url to see if that is the issue ?
Dave
Tried commenting them out, reload, still the same result...
Hi Warren,
I'm running out of ideas here.
Could you check if you view the page that the request verifcation is set ? Could be that something is blocking your cookie from being set.
Dave
Thanks Dave - me too! It's got me stuffed.. Yes, the __RequestVerificationToken is definitely there in the form elements in the front-end and it's being posted in the request parameters.
Hi Warren,
There should also be a cookie written, besides the hidden form field. Can you check that ?
Dave
is working on a reply...