浏览器和服务器的异常通话
常用方法
setAttribute(String key,Object value);//设置值
getAttribute(String key); //取值
Invalidate(); //设置session失败
getId(); //获取sessionid
setMaxInactiveInterval(); //获取session的有效非活动时间(以秒为单位)
removeAttribute(String key); //从session中删除指定名称(key)所对应的对象
注意:每个session对象都与浏览器一一对应。
重新开启一个浏览器,相当于重新创建一个session对象。
通过超链接打开的新窗口,新窗口的session与其父窗口的session相同。