explaingit

carhartl/jquery-cookie

8,503JavaScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

An archived jQuery plugin that simplified reading, writing, and deleting browser cookies with one-line calls. No longer maintained, active development moved to its successor library JS Cookie, which works without jQuery.

Mindmap

mindmap
  root((jquery-cookie))
    Features
      Read cookies
      Write cookies
      Delete cookies
      JSON storage
    Options
      Expiration dates
      Domain path
      HTTPS only
    Status
      Archived project
      Successor JS Cookie
    Audience
      Legacy jQuery sites
      Migration reference
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Reference legacy jQuery cookie handling code when maintaining an older web project that already uses this plugin.

USE CASE 2

Understand how the JS Cookie successor library evolved and how to migrate from this plugin to it.

Tech stack

JavaScriptjQuery

Getting it running

Difficulty · easy Time to first run · 5min

This project is abandoned, use the JS Cookie successor library for any new project.

License not specified in the explanation.

In plain English

This repository is an archived jQuery plugin that made it easier to read, write, and delete browser cookies using JavaScript. Cookies are small pieces of data that websites store in a visitor's browser to remember things like login status, preferences, or session information. This plugin simplified the process of working with them in web pages that used jQuery, a popular JavaScript library from an earlier era of web development. The project has been abandoned and is no longer maintained. The README prominently notes that active development moved to a separate repository called JS Cookie, which is a rewrite that dropped the jQuery dependency. Anyone looking for a working version of this functionality is directed to that successor project. For historical reference, the plugin worked by attaching a cookie function to the jQuery dollar-sign object. You could create a cookie with an expiration date, read back its value, or remove it, all with short one-line calls. It also supported storing JSON objects directly as cookie values, and allowed configuring options like which domain path the cookie should be valid for and whether it required a secure HTTPS connection. This repository has over 8,500 stars largely accumulated during the period when it was the standard way to handle cookies in jQuery-based web projects. It is preserved here for reference but should not be used in new projects. The successor library at the linked repository handles the same use cases without requiring jQuery.

Copy-paste prompts

Prompt 1
I have a legacy jQuery site that uses jquery-cookie. Show me exactly how to migrate each call to the JS Cookie successor library without changing cookie behavior.
Prompt 2
How do I read, write, and delete a cookie with an expiration date using the JS Cookie library that replaced jquery-cookie?
Prompt 3
What is the JS Cookie equivalent of the old jquery-cookie feature that stores a JavaScript object as a JSON cookie value?
Open on GitHub → Explain another repo

← carhartl on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.