Started

Selectors

Utilities

Animation

AJAX

CSS

Event

Manipulation

Cookie

String

Attributes

Data

Storage

Miscellaneous

$cookie.remove

Remove cookie data.
$cookie.remove( key [, key1] [,key2] )
  1. key [string]
    The key name of data saved in cookie.

Notes

The common function to remove data from cookie.

Example

HTML code
<div id="message"></div>
<button onclick="start_cookie_set()">Save "Hello" into cookie as name "data".</button>
<button onclick="start_cookie_get()">Get "data" from cookie</button>
<button onclick="start_cookie_remove()">Remove "data" from cookie</button>
JavaScript code
function start_cookie_get()
{
	$html($("message"), "The value of 'data' in cookie is '" + $cookie.get("data") + "' and the value of 'foo' is '" + $cookie.get("foo") + "'");
}

function start_cookie_set()
{
	$cookie.set("data", "Hello");
	$cookie.set({
		"world": "Hello",
		"foo": "bar"
	});

	$html($("message"), "The value is saved into cookie!" );
}

function start_cookie_remove()
{
	$cookie.remove("data", "world", "foo");
	$html($("message"), "The value 'Hello' of 'data' is removed from cookie!");
}
Demonstration