Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function getCookie(name) {
  2. var cookieValue = null;
  3. if (document.cookie && document.cookie != '') {
  4. var cookies = document.cookie.split(';');
  5. for (var i = 0; i < cookies.length; i++) {
  6. var cookie = jQuery.trim(cookies[i]);
  7. // Does this cookie string begin with the name we want?
  8. if (cookie.substring(0, name.length + 1) == (name + '=')) {
  9. cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
  10. break;
  11. }}}
  12. return cookieValue;}
  13.  
  14.  
  15. getCookie('csrftoken');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement