Welcome Guest, Not a member yet? Register   Sign In
Almost got AJAX requests playing nicely with CSRF... almost.
#4

[eluser]Unknown[/eluser]
The browser makes an AJAX request. In that request, a special header is set: X-Requested-With. This header is non-standard, but it’s used by many JavaScript libraries (i.e., jQuery, Prototype).
On the server side, the server validates the request to make sure the header exists in the request. If it doesn’t, the request is rejected. If you’re using a library like jQuery, this is the only bit of code you have to implement.
best electric fence


Messages In This Thread
Almost got AJAX requests playing nicely with CSRF... almost. - by El Forum - 04-23-2011, 01:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB