31 jQuery.cookie =
function(name, value, options) {
32 if (typeof value !=
'undefined') {
33 options = options || {};
39 if (options.expires && (typeof options.expires ==
'number' || options.expires.toUTCString)) {
41 if (typeof options.expires ==
'number') {
43 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
45 date = options.expires;
47 expires =
'; expires=' + date.toUTCString();
52 var path = options.path ?
'; path=' + (options.path) :
'';
53 var domain = options.domain ?
'; domain=' + (options.domain) :
'';
54 var secure = options.secure ?
'; secure' :
'';
55 document.cookie = [name,
'=', encodeURIComponent(value), expires, path, domain, secure].join(
'');
57 var cookieValue = null;
58 if (document.cookie && document.cookie !=
'') {
59 var cookies = document.cookie.split(
';');
60 for (var i = 0; i < cookies.length; i++) {
63 if (cookie.substring(0, name.length + 1) == (name +
'=')) {
64 cookieValue = decodeURIComponent(cookie.substring(name.length + 1));