Skip to content

Instantly share code, notes, and snippets.

@jerrybendy
Created June 20, 2016 14:44
Show Gist options
  • Save jerrybendy/35a71c0623d893267d41b9e523041fa8 to your computer and use it in GitHub Desktop.
Save jerrybendy/35a71c0623d893267d41b9e523041fa8 to your computer and use it in GitHub Desktop.
使用jQuery/JS操作浏览器Cookie https://icewing.cc/jquery-cookie.html
// 设置Cookie, 有效期2小时
$.setCookie('test', 'This is value', 7200);
// 获取Cookie的值
alert($.getCookie('test'));
// 删除刚刚设置的Cookie
$.removeCookie('test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment