Say I have a simple AJAX request as follows:
$.ajax({
type: 'POST',
data: {
someParam: 'some param value'
}
})
I would like to know when this request is sent. I thought of two ways:
- My first thought was to just add another param with the value of Date.now(). But that can be easily changed by someone using something like fiddler.
- Another way would be to encrypt the value of Date.now() and send the encrypted value as a param, and then decode it on the server side.
- Would adding this value in the header provide an extra layer of security somehow?
So is there any way to accurately and securely track this? Or at the very least, is there some way I can track this and make it difficult for someone fabricate a value?