{"id":13468922,"url":"https://github.com/carhartl/jquery-cookie","last_synced_at":"2025-10-05T17:31:46.536Z","repository":{"id":627541,"uuid":"268027","full_name":"carhartl/jquery-cookie","owner":"carhartl","description":"No longer maintained, superseded by JS Cookie:","archived":true,"fork":false,"pushed_at":"2017-06-19T08:44:42.000Z","size":454,"stargazers_count":8533,"open_issues_count":0,"forks_count":4004,"subscribers_count":435,"default_branch":"master","last_synced_at":"2025-10-02T12:29:37.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/js-cookie/js-cookie","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carhartl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-08-03T19:11:40.000Z","updated_at":"2025-09-16T15:47:04.000Z","dependencies_parsed_at":"2022-07-07T14:38:15.931Z","dependency_job_id":null,"html_url":"https://github.com/carhartl/jquery-cookie","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/carhartl/jquery-cookie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carhartl%2Fjquery-cookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carhartl%2Fjquery-cookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carhartl%2Fjquery-cookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carhartl%2Fjquery-cookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carhartl","download_url":"https://codeload.github.com/carhartl/jquery-cookie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carhartl%2Fjquery-cookie/sbom","scorecard":{"id":265741,"data":{"date":"2025-08-11","repo":{"name":"github.com/carhartl/jquery-cookie","commit":"d72bb07e29962330db61aae1eda07f6312419840"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 5/29 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: MIT-LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: MIT-LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.4.1 not signed: https://api.github.com/repos/carhartl/jquery-cookie/releases/291272","Warn: release artifact v1.4.1 does not have provenance: https://api.github.com/repos/carhartl/jquery-cookie/releases/291272"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T11:58:16.515Z","repository_id":627541,"created_at":"2025-08-17T11:58:16.516Z","updated_at":"2025-08-17T11:58:16.516Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278426644,"owners_count":25984903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:01:21.930Z","updated_at":"2025-10-05T17:31:46.277Z","avatar_url":"https://github.com/carhartl.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Javascript","Storage","Storage [🔝](#readme)","38. 实用工具/其他插件 ##","存储","41. 实用工具/其他插件"],"sub_categories":["Data / Files","Runner","13.20 视差滚动(Parallax Scrolling) ###","运行器","24.3 Web Sockets","运行器e2e测试"],"readme":"# IMPORTANT!\n\nThis project was moved to https://github.com/js-cookie/js-cookie, check [the discussion](https://github.com/carhartl/jquery-cookie/issues/349).\n\nNew issues should be opened at https://github.com/js-cookie/js-cookie/issues\n\n# jquery.cookie [![Build Status](https://travis-ci.org/carhartl/jquery-cookie.png?branch=master)](https://travis-ci.org/carhartl/jquery-cookie) [![Code Climate](https://codeclimate.com/github/carhartl/jquery-cookie.png)](https://codeclimate.com/github/carhartl/jquery-cookie)\n\nA simple, lightweight jQuery plugin for reading, writing and deleting cookies.\n\n**If you're viewing this, you're reading the documentation for the old repository.\n[View documentation for the latest backwards compatible release (1.5.1).](https://github.com/js-cookie/js-cookie/tree/v1.5.1)**\n\n## Build Status Matrix\n\n[![Selenium Test Status](https://saucelabs.com/browser-matrix/jquery-cookie.svg)](https://saucelabs.com/u/jquery-cookie)\n\n## Installation\n\nInclude script *after* the jQuery library (unless you are packaging scripts somehow else):\n\n```html\n\u003cscript src=\"/path/to/jquery.cookie.js\"\u003e\u003c/script\u003e\n```\n\n**Do not include the script directly from GitHub (http://raw.github.com/...).** The file is being served as text/plain and as such being blocked\nin Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN.\n\nThe plugin can also be loaded as AMD or CommonJS module.\n\n## Usage\n\nCreate session cookie:\n\n```javascript\n$.cookie('name', 'value');\n```\n\nCreate expiring cookie, 7 days from then:\n\n```javascript\n$.cookie('name', 'value', { expires: 7 });\n```\n\nCreate expiring cookie, valid across entire site:\n\n```javascript\n$.cookie('name', 'value', { expires: 7, path: '/' });\n```\n\nRead cookie:\n\n```javascript\n$.cookie('name'); // =\u003e \"value\"\n$.cookie('nothing'); // =\u003e undefined\n```\n\nRead all available cookies:\n\n```javascript\n$.cookie(); // =\u003e { \"name\": \"value\" }\n```\n\nDelete cookie:\n\n```javascript\n// Returns true when cookie was successfully deleted, otherwise false\n$.removeCookie('name'); // =\u003e true\n$.removeCookie('nothing'); // =\u003e false\n\n// Need to use the same attributes (path, domain) as what the cookie was written with\n$.cookie('name', 'value', { path: '/' });\n// This won't work!\n$.removeCookie('name'); // =\u003e false\n// This will work!\n$.removeCookie('name', { path: '/' }); // =\u003e true\n```\n\n*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie, unless you're relying on the default options that is.*\n\n## Configuration\n\n### raw\n\nBy default the cookie value is encoded/decoded when writing/reading, using `encodeURIComponent`/`decodeURIComponent`. Bypass this by setting raw to true:\n\n```javascript\n$.cookie.raw = true;\n```\n\n### json\n\nTurn on automatic storage of JSON objects passed as the cookie value. Assumes `JSON.stringify` and `JSON.parse`:\n\n```javascript\n$.cookie.json = true;\n```\n\n## Cookie Options\n\nCookie attributes can be set globally by setting properties of the `$.cookie.defaults` object or individually for each call to `$.cookie()` by passing a plain object to the options argument. Per-call options override the default options.\n\n### expires\n\n    expires: 365\n\nDefine lifetime of the cookie. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` object. If omitted, the cookie becomes a session cookie.\n\n### path\n\n    path: '/'\n\nDefine the path where the cookie is valid. *By default the path of the cookie is the path of the page where the cookie was created (standard browser behavior).* If you want to make it available for instance across the entire domain use `path: '/'`. Default: path of page where the cookie was created.\n\n**Note regarding Internet Explorer:**\n\n\u003e Due to an obscure bug in the underlying WinINET InternetGetCookie implementation, IE’s document.cookie will not return a cookie if it was set with a path attribute containing a filename.\n\n(From [Internet Explorer Cookie Internals (FAQ)](http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx))\n\nThis means one cannot set a path using `path: window.location.pathname` in case such pathname contains a filename like so: `/check.html` (or at least, such cookie cannot be read correctly).\n\n### domain\n\n    domain: 'example.com'\n\nDefine the domain where the cookie is valid. Default: domain of page where the cookie was created.\n\n### secure\n\n    secure: true\n\nIf true, the cookie transmission requires a secure protocol (https). Default: `false`.\n\n## Converters\n\nProvide a conversion function as optional last argument for reading, in order to change the cookie's value\nto a different representation on the fly.\n\nExample for parsing a value into a number:\n\n```javascript\n$.cookie('foo', '42');\n$.cookie('foo', Number); // =\u003e 42\n```\n\nDealing with cookies that have been encoded using `escape` (3rd party cookies):\n\n```javascript\n$.cookie.raw = true;\n$.cookie('foo', unescape);\n```\n\nYou can pass an arbitrary conversion function.\n\n## Contributing\n\nCheck out the [Contributing Guidelines](CONTRIBUTING.md)\n\n## Authors\n\n[Klaus Hartl](https://github.com/carhartl)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarhartl%2Fjquery-cookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarhartl%2Fjquery-cookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarhartl%2Fjquery-cookie/lists"}