Skip to content

Instantly share code, notes, and snippets.

@hpneo
Created December 7, 2011 00:26
Show Gist options
  • Save hpneo/1440782 to your computer and use it in GitHub Desktop.
Save hpneo/1440782 to your computer and use it in GitHub Desktop.
Evitar perder sesiones al realizar requests vía AJAX
$.ajax({
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
data1: value1,
data2: value2,
data3: value3
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment