0

I would like to have nonce key forever, i don't want to change or refresh. Any idea?

add_filter( 'nonce_life', function () { return 4 * 1000000000000000000; } );
  • Why have a nonce at all then? – Jacob Peattie Nov 29 '17 at 9:06
1

A nonce is a "number used once" to help protect URLs and forms from certain types of misuse, malicious or otherwise. WordPress nonces aren't numbers, but are a hash made up of numbers and letters. Nor are they used only once, but have a limited "lifetime" after which they expire. During that time period the same nonce will be generated for a given user in a given context. The nonce for that action will remain the same for that user until that nonce life cycle has completed.

so it used for security reasons ,and your idea to have fixed one against that concept ,so as @Jacob Peattie said why then have a nonce at all??!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.