Skip to content

Instantly share code, notes, and snippets.

View aherok's full-sized avatar

Andrzej Herok aherok

View GitHub Profile
/*
CSRF AJAX HANDLING
*/
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?