Maximum lifetime for nonce


In our project we allow users to buy a coupon ( WooCommerce product ) for some service. We save every coupon as a custom post type with all the customer data inserted during purchase.

We then via email send a link to download the coupon in PDF. We use WooCommerce PDF Invoices & Packing Slips plugin for generating PDFs and links are generated in this manner:

$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=Coupon-PDF&order_id=' . $order->id ), 'generate_wpo_wcpdf' );

The problem is obviously the lifetime of nonce. We would need to link to be active at least one year, meaning that we should set the nonce to 2 years. I did quite some research but could not find proper information.

Question is: what is the maximum lifetime for nonce?

Additionally: It would be great it somebody shared their experiences with extending nonce lifetime by a lot, like in this case.

, , , , Domas 5 years 2016-08-30T04:19:41-05:00 0 Answers 81 views 0

Leave an answer