{"_id":"jquery.cookie","_rev":"22-6eb1fce25eaf2ba5c97108eab7e262a8","name":"jquery.cookie","dist-tags":{"latest":"1.4.1"},"versions":{"1.4.1":{"name":"jquery.cookie","version":"1.4.1","author":{"name":"Klaus Hartl"},"license":"MIT","_id":"jquery.cookie@1.4.1","maintainers":[{"name":"carhartl","email":"klaus.hartl@gmail.com"}],"homepage":"https://github.com/carhartl/jquery-cookie","bugs":{"url":"https://github.com/carhartl/jquery-cookie/issues"},"jam":{"main":"jquery.cookie.js","include":["jquery.cookie.js"],"dependencies":{"jquery":">=1.2"}},"dist":{"shasum":"d63dce209eab691fe63316db08ca9e47e0f9385b","tarball":"https://registry.npmjs.org/jquery.cookie/-/jquery.cookie-1.4.1.tgz","integrity":"sha512-c/hZOOL+8VSw/FkTVH637gS1/6YzMSCROpTZ2qBYwJ7s7sHajU7uBkSSiE5+GXWwrfCCyO+jsYjUQ7Hs2rIxAA==","signatures":[{"sig":"MEUCIGxreg8Z6l3WTXkSVzgFsZ1qea2TyKoTjXpJY8QfG3dPAiEAkULDCgIQLbUbwTppmx/ZMGqQz+GvlyR/+42hAknHHJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jspm":{"main":"jquery.cookie","files":["jquery.cookie.js"],"buildConfig":{"uglify":true}},"main":"jquery.cookie.js","volo":{"url":"https://raw.github.com/carhartl/jquery-cookie/v{version}/jquery.cookie.js"},"_from":".","gitHead":"bd3c9713222bace68d25fe2128c0f8633cad1269","scripts":{"test":"grunt"},"_npmUser":{"name":"carhartl","email":"klaus.hartl@gmail.com"},"repository":{"url":"git://github.com/carhartl/jquery-cookie.git","type":"git"},"_npmVersion":"1.4.6","description":"A simple, lightweight jQuery plugin for reading, writing and deleting cookies.","directories":{"test":"test"},"devDependencies":{"grunt":"~0.4.1","gzip-js":"~0.3.0","grunt-saucelabs":"~4.1.1","grunt-compare-size":"~0.4.0","grunt-contrib-qunit":"~0.2.0","grunt-contrib-watch":"~0.3.0","grunt-contrib-jshint":"~0.4.0","grunt-contrib-uglify":"~0.2.0","grunt-contrib-connect":"~0.5.0"}}},"time":{"created":"2014-04-27T20:19:24.024Z","modified":"2024-08-23T10:02:25.646Z","1.4.1":"2014-04-27T20:19:24.024Z"},"bugs":{"url":"https://github.com/carhartl/jquery-cookie/issues"},"author":{"name":"Klaus Hartl"},"license":"MIT","homepage":"https://github.com/carhartl/jquery-cookie","repository":{"url":"git://github.com/carhartl/jquery-cookie.git","type":"git"},"description":"A simple, lightweight jQuery plugin for reading, writing and deleting cookies.","maintainers":[{"name":"carhartl","email":"klaus.hartl@gmail.com"}],"readme":"# 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 at https://github.com/carhartl/jquery-cookie, you're reading the documentation for the master branch.\n[View documentation for the latest release (1.4.1).](https://github.com/carhartl/jquery-cookie/tree/v1.4.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<script src=\"/path/to/jquery.cookie.js\"></script>\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('the_cookie', 'the_value');\n```\n\nCreate expiring cookie, 7 days from then:\n\n```javascript\n$.cookie('the_cookie', 'the_value', { expires: 7 });\n```\n\nCreate expiring cookie, valid across entire site:\n\n```javascript\n$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' });\n```\n\nRead cookie:\n\n```javascript\n$.cookie('the_cookie'); // => \"the_value\"\n$.cookie('not_existing'); // => undefined\n```\n\nRead all available cookies:\n\n```javascript\n$.cookie(); // => { \"the_cookie\": \"the_value\", \"...remaining\": \"cookies\" }\n```\n\nDelete cookie:\n\n```javascript\n// Returns true when cookie was found, false when no cookie was found...\n$.removeCookie('the_cookie');\n\n// Same path as when the cookie was written...\n$.removeCookie('the_cookie', { path: '/' });\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> 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); // => 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","readmeFilename":"README.md","users":{"feril":true,"rioli":true,"timdp":true,"yichan":true,"ungurys":true,"tmurngon":true,"wsapiens":true,"rie-picos":true,"shakakira":true,"sternelee":true,"ya_feng_li":true,"chinawolf_wyp":true,"highlanderkev":true,"andrew.oxenburgh":true}}