一般网页登陆之后,账号和用户信息存储在哪?是存储本地在cookie、sessionStorage、localStorage里面。还是通过url传递参数查询?求大神指导,有哪种方式更安全方便。window.sessionStorage.name='rainman';//赋值window.sessionStorage.setItem('name','cnblogs');//赋值window.sessionStorage.getItem('name');//取值window.sessionStorage.removeItem('name');//移除值window.sessionStorage.clear();//删除所有sessionStoragelocalStorage.setItem("me",JSON.stringify(person));//获取cookiefunctiongetCookie(name){varstrCookie=document.cookie;vararrCookie=strCookie.split(";");for(vari=0;ivararr=arrCookie[i].split("="); if(arr[0]==name)returnarr[1];}return"";}url&id=??
桃花长相依
相关分类