1)在jsp中创建Cookie时,必须保证Cookie创建语句写在jsp页面头部的<jsp:include page="includes/head.jsp" flush="true" />标签之前才会生效,否则手动添加的Cookie失败。
2)在<jsp:include page="includes/head.jsp" flush="true" />中也无法生成cookie和修改cookie,只能获取到已有的cookie
3)可以改用<%@ include file="includes/head.jsp" %>来引入就可以了
2)在<jsp:include page="includes/head.jsp" flush="true" />中也无法生成cookie和修改cookie,只能获取到已有的cookie
3)可以改用<%@ include file="includes/head.jsp" %>来引入就可以了