我的session在关闭浏览器时为什么没有被清空啊 急啊
我在adminManage.jsp里为了防止用户知道URL后的非法访问,设了session判断,直接输入URL地址后,正常跳转到登陆界面,但是通过正常方法登陆到此页后直接关闭浏览器,从新开个窗口输入adminManage.jsp的URL却进入了该页面,请问我关闭该页面时为什么没有清空session呢?
adminManage.jsp代码如下:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
</head>
<body>
<%@ include file="adminSession.inc" %>
<%@ include file="css.inc" %>
<p align="center"><font color="#FF0000" size="5"><b>煤矿实时信息查询用户管理</b></font></p>
<body bgcolor="#A5C5EF">
<p align="center"> </p>
<p align="left"> </p>
<p align="left">
<a href="add.jsp"><font size="6">添加用户</font></a></p>
<p align="left">
<a href="delete.jsp"><font size="6">删除用户</font></a></p>
</body>
</html>
---------------------------------------------------------------------------------------
adminSession.inc 代码如下
<%
String Name=(String)session.getAttribute("name");
if(Name == null)
{
response.sendRedirect("Admin.jsp");
//将浏览器导向指定的页面
}
%>
--------------------------------------------------------------------------------------
adminLogin.jsp 代码如下
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page errorPage="error.jsp" %>
<html>
<body>
<%--进行登陆检查--%>
<%
String name=request.getParameter("name");
String password=request.getParameter("password");
//else forward-->loginerr.jsp
if(name.equals("cyuts")& password.equals("mk321"))
{
session.setAttribute("name",name);
response.sendRedirect("adminManage.jsp");
}//if
else
{
%>
<jsp:forward page="loginErr.jsp">
<jsp:param name="user" value="<%=name%>"/>
</jsp:forward>
<%}%>
</body>
</html>