From 15b241c871197aa72cc106b97dbd116fda0f7f24 Mon Sep 17 00:00:00 2001 From: ZapBird Date: Mon, 8 Aug 2022 20:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E4=BA=86=E4=B8=80=E4=B8=AA=E2=80=9C?= =?UTF-8?q?=E7=9A=84=E2=80=9D=EF=BC=8C=E4=B8=8D=E5=A5=BD=E6=84=8F=E6=80=9D?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=B7=B1=E5=BC=BA=E8=BF=AB=E7=97=87=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/system-design/J2EE基础知识.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/system-design/J2EE基础知识.md b/docs/system-design/J2EE基础知识.md index 22ce6911..62f906a4 100644 --- a/docs/system-design/J2EE基础知识.md +++ b/docs/system-design/J2EE基础知识.md @@ -280,7 +280,7 @@ if(cookies !=null){ 在所有会话跟踪技术中,HttpSession对象是最强大也是功能最多的。当一个用户第一次访问某个网站时会自动创建 HttpSession,每个用户可以访问他自己的HttpSession。可以通过HttpServletRequest对象的getSession方 法获得HttpSession,通过HttpSession的setAttribute方法可以将一个值放在HttpSession中,通过调用 HttpSession对象的getAttribute方法,同时传入属性名就可以获取保存在HttpSession中的对象。与上面三种方式不同的 是,HttpSession放在服务器的内存中,因此不要将过大的对象放在里面,即使目前的Servlet容器可以在内存将满时将HttpSession 中的对象移到其他存储设备中,但是这样势必影响性能。添加到HttpSession中的值可以是任意Java对象,这个对象最好实现了 Serializable接口,这样Servlet容器在必要的时候可以将其序列化到文件中,否则在序列化时就会出现异常。 -## Cookie和Session的的区别 +## Cookie和Session的区别 Cookie 和 Session都是用来跟踪浏览器用户身份的会话方式,但是两者的应用场景不太一样。