You will need to add some token unique to this request / session. If it is simply authenticated, you can guarantee that it came from someone with details, but it can still be "faked" from this user.
You can either check all the “known” tokens with an expiration date, or use a session-based system and check its correctness in the request handler.
If only tokens are used. you will need to generate them on the server when sending the page that makes the request, and then it is checked when processing the request itself.
source share