That is basically the way WordPress does it and pretty much the only way to do it, simply have your receiving PHP function create a new nonce add send it back with your response, then just update the value on your JS before the next round.
Related Posts:
- Nonces and Cache
- Is it safe to assume that a nonce may be validated more than once?
- Nonces, AJAX, script variables & security in WordPress
- How do I check if AJAX nonces are implemented correctly?
- WP Admin AJAX Security – using POST to include a relative URL
- ajax nonce verification failing
- Why does check_ajax_referer give a 403 error on https websites?
- Using nonce when loading posts with AJAX
- Should wordpress nonce be placed in html form or in javascript file
- Ajax Security regarding user priviliges and nonces
- How to stop a nonce from being cached in an inline script, or alternatives to regenerate it if expired?
- How to get a unique nonce for each Ajax request?
- WordPress Ajax Data Security
- Nonces can be reused multiple times? Bug / Security issue?
- Using Nonces for AJAX that only retrieves data
- How to verify nonce from Bulk/Quick Edit in save_post?
- How to add WordPress nonces to ajax request
- Security – Ajax and Nonce use [closed]
- Nonces and Ajax request to REST API and verification
- Ajax function returns -1
- Serving nonces through AJAX is not refreshing nonce, returning 403 error
- wp_verify_nonce always returns false when logged in as admin
- ajax and nonce when JavaScript is in a seperate file
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- AJAX requests broken due to HTTPS for wp-admin
- Why does WordPress Heartbeat login not refresh the nonces?
- wp-admin AJAX with Fetch API is done without user
- How to check an ajax nonce in PHP
- Can a wp_nonce created from domain 1 to be verified on domain 2?
- Is it safe to manually sign a user in using AJAX?
- how to send Ajax request in wordpress backend
- Identical wp_rest nonce returned from rest_api
- wp_create_nonce() in REST API makes user->ID zero
- SSO autologin WordPress + Ajax
- Should I check for privileges before hooking into `wp_ajax_$handle` or after?
- Nonce fails on ajax save
- Is it secure to use admin-ajax.php in front?
- Unable to successfully verify nonce
- Cache plugins and ajax nonce verification
- Nonce doesn’t validate in nopriv call
- WordPress is creating nonce as a logged in user but verifying it incorrectly
- javascript ajax and nonce
- How to check nonce lifetime value of plugins?
- 200 return code on ‘POST /wp-admin/admin-ajax.php’ while NOT logged in
- Custom RPC end-point security best pratice?
- How to prevent my external API call from being called by anyone but me (my site)
- wp_verify_nonce not working on the mobile device
- How do I mitigate replay attacks when talking about actions that shouldn’t happen twice?
- check_ajax_reffer not working when logged
- How to safely pass post_id and user_id via AJAX to the backend (prevent user from changing it via JS)?
- AJAX form not working, still reloads on submit
- How to use nonces for frontend AJAX voting if the page gets cached?
- Can I make an ajax response cross-domain?
- WordPress wp_localize_script nonce and ajax URL
- How does the security of admin_ajax.php work?
- Ajax takes 10x as long as it should/could
- redirect out of wp-admin, without losing admin-ajax.php
- How to implement AJAX post navigation into WordPress?
- wp_ajax_[service] returning 0
- Trying to load content of a post via AJAX
- Insert Post using Ajax
- How can I automatically login using a URL?
- Problems with creating sortable sections in customizer
- Is it OK to use a system cron to trigger a function hooked into the AJAX API
- Filter WP user acf field by ajax
- Ajax Request not coming back to class
- fetching via fetch/ajax gutenberg block data from third party
- How to make ajax content indexable by search engines?
- Confusion on WP Nonce usage in my Plugin
- Ajax requests with different WordPress Address and Site Address setup
- Conditional action hooks
- query vars in url work but not in ajax call
- is_home doesn’t affect content
- Cookie nonce is invalid – Multisite
- Is it safe to use $_POST directly in my plugin instead of using admin-ajax.php to receive data from ajax?
- How to make get_theme_mod work with AJAX in the customizer preview
- Security checking in meta_box save is reluctant?
- How to declare a JS variable in an AJAX call
- is_page() conditional not working inside an AJAX function
- jQuery Ajax passing empty parameters to my function?
- Fatal error: Call to undefined function get_post() with ajax
- Convert this relative path to absolute
- admin-ajax.php slow website, how to fix
- Plugin: AJAX query external API to sync to tables
- admin-ajax.php ” Missing argument 2″ warning
- Update get_pages using ajax on form select change
- splitting the URL using jQuery
- How do I get reusable blocks via frontend REST API?
- Is there builtin way to use protected AJAX endpoint?
- How to create an ajax endpoint without js?
- WordPress admin-ajax.php not available for subscribers/contributors
- Load More Posts Button – AJAX
- WP Ajax never returning any data / calling action
- Refresh Markercluster after ajax call
- How to load content from many posts on a page, only if needed
- Making an ajax request from a different domain
- Mapping Backbone Models to serialized array in wp_options table
- WordPress Settings api data not sanitized if i use ajax
- Ajax login without redirect/reload
- wp_mail 200 response but no mail sent