I need to restrict POST request from specific domain. As far I know, HTTP_REFERER checking cannot be a good solution because it can be spoofed. So what can be the good solution when two different websites from different technology and web servers will work together?
I need to restrict POST request from specific domain. As far I know, HTTP_REFERER
Share
Heres a method you could try, by adding a hidden field within your form that is session values that are set server side. This way if the form has not originated from your server the session would not have been set and the values would not match.
Example:
Alternatively you could use encryption instead of hashing, that way you could check the values: