I have a challenge that may be more complex than this board can help with...
I'm writing a plugin that allows people to add or remove photos to a "Lightbox" that gets attached to their user metadata - sort of like a "favorite posts" function that stores the post IDs of photos in an array. The Lightbox is binary: if the photo isn't in the Lightbox it gets added, if the photo is in the Lightbox, it gets removed. The user metadata is updated each time accordingly.
Currently I can't figure out how to dynamically update and regenerate the nonces for the add and remove functions for the Ajax calls.
This is where I'm hoping to get some tips-- how does one request a new nonce in the receiving php, assign the Ajax js object that variable, and then send it back to the requesting page for the "next" ajax sequence(s)?