summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/cookies.js
blob: 6a2f9d4f155095627002f225212881e48f266727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// by tauren
// https://github.com/Modernizr/Modernizr/issues/191

Modernizr.addTest('cookies', function () {
  // Quick test if browser has cookieEnabled host property
  if (navigator.cookieEnabled) return true;
  // Create cookie
  document.cookie = "cookietest=1";
  var ret = document.cookie.indexOf("cookietest=") != -1;
  // Delete cookie
  document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
  return ret;
});