jquery保存用戶信息cookie



jquery.cookie.js下載:

http://download.csdn.net/detail/qust_2011/7200145

//保存
var userId= 2889;
var info='age:22,name:april';
$.cookie(userId,info,{path:'/',expires:1});//保存一天到 當前路徑
//獲取
var info= $.cookie(userId);
//刪除
var info= $.cookie(userId);
if(info!=null){
	$.cookie(userId,null,{path:'/'});
}




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章