Skip to content

Instantly share code, notes, and snippets.

@vijedi
Created February 8, 2012 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijedi/1769263 to your computer and use it in GitHub Desktop.
Save vijedi/1769263 to your computer and use it in GitHub Desktop.
CSRF Token: The Wrong way.
$("body").bind("ajaxSend", function(elm, xhr, s){
if (s.type == "POST") {
xhr.setRequestHeader('X-CSRF-Token', Common.CSRF_TOKEN);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment