The jquery cookie requires the script file as follows: Jquery.cookie = function (name, value, options) {if (typeof value! = ' undefined ') {options = Optio NS | | {}; if (value = = = NULL) {value = '; Options = $.extend ({}, Options); Options.expires =-1; } var expires = '; if (Options.expires && (typeof options.expires = = ' Number ' | | options.expires.toUTCString)) {var date; if (typeof options.expires = = ' number ') {date = new date (); Date.settime (Date.gettime () + (Options.expires * 24 * 60 * 60 * 1000)); } else {date = Options.expires; } expires = '; Expires= ' + date.toutcstring (); } var path = Options.path? ‘; Path= ' + (Options.path): '; var domain = Options.domain? ‘; Domain= ' + (options.domain): '; var secure = options.secure? ‘; Secure ': '; Document.cookie = [name, ' = ', encodeURIComponent (value), expires, path, domain, Secure].join (");} else {var cookievalue = null; if (document.cookie && document.cookie! = ") {var cookies= Document.cookie.split (';'); for (var i = 0; i < cookies.length; i++) {var cookie = Jquery.trim (Cookies[i]); if (cookie.substring (0, name.length + 1) = = (name + ' = ')) {cookievalue = decodeURIComponent (cookie.substring (name.le Ngth + 1)); Break }}}; return cookievalue;}};page Call just introduce this file$.cookie ("name"); The cookie value is $.cookie ("name", "value") based on the cookie name, and/or set the cookie name, value $.cookie ("name", "value", "{expires:7}"); Set cookie name, value, life cycle and other attributes $.cookie ("name", null); Remove cookies based on cookie name
jquery Read-Write cookie