Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @danhrpr

    Thank you for contacting Payment Plugins. You want to make sure that you exclude the Javascript variable wc_braintree_client_manager_params from caching. The reason is that JS variable contains the security nonce that’s used to validate the WordPress REST API request.

    The reason it’s failing in your case is the nonce is only good for a set number of hours and since you’re serving a cached nonce, it fails the validation check that WordPress core has in place.

    Kind Regards

    Thread Starter Daniel Harper

    (@danhrpr)

    Thanks for the quick resposne,

    I can see the nonce is cached in the html but I do need to cache the html on the product pages, it’s easier with cart etc because I have cache exclusions. I also have exclusions when specific cookies exist so not sure how I can get around this one.

    do you have any pointers on that?

    If I reduce the cache time and page is refreshed every 4hrs then it should work?

    Cheers Dan

    Plugin Author Clayton R

    (@mrclayton)

    Hi @danhrpr

    If I reduce the cache time and page is refreshed every 4hrs then it should work?

    Yes that should work because a nonce has a 24 hour lifespan which is well within your 4hr window.

    Kind Regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Invalid nonce’ is closed to new replies.