How to use the cheerio.cookie function in cheerio

To help you get started, we’ve selected a few cheerio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Sefaria / Sefaria-Project / static / js / sefaria / sefaria-06.js View on Github external
saveRecentItem: function(recentItem) {
    var recent = Sefaria.recentlyViewed;
    if (recent.length && recent[0].ref == recentItem.ref) { return; }
    recent = recent.filter(function(item) {
      return item.book !== recentItem.book; // Remove this item if it's in the list already
    });
    recent.splice(0, 0, recentItem);
    Sefaria.recentlyViewed = recent;
    var packedRecent = recent.map(Sefaria.packRecentItem);
    if (Sefaria._uid) {
        $.post("/api/profile", {json: JSON.stringify({recentlyViewed: packedRecent})}, function(data) {} );
    } else {
      var cookie = INBROWSER ? $.cookie : Sefaria.util.cookie;
      packedRecent = packedRecent.slice(0, 6);
      cookie("recentlyViewed", JSON.stringify(packedRecent), {path: "/"});
    }
  },
  packRecentItem: function(item) {