1、设置cookie var cp = new Ext.state.CookieProvider({ path: "/cgi-bin/", //激活cookie的路径 expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days domain: "extjs.com" }); Ext.state.Manager.setProvider(cp); cp.set("username","abc") 2、获得cookie var cp = new Ext.state.CookieProvider(); alert(cp.get('username')); 3、删除cookie var cp = new Ext.state.CookieProvider(); cp.clear('username');