今天在帮同学修改一个页面时,发现在使用response.redirect后cookies值出现丢失的情况。我用一下两个页面做实验,结果在他机器还是出现cookies丢失情况,但是在我的机器上就不会出新cookies值丢失的情况!!
1.asp复制内容到剪贴板
代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>cookies值丢失--叶面1</title>
</head>
<body>
<%
response.Cookies("I")="csslong"
response.Redirect("2.asp")
'response.Write(request.Cookies("I"))
%>
</body>
</html>2.asp复制内容到剪贴板
代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>cookies值丢失--叶面2</title>
</head>
<body>
<%
response.write(request.Cookies("I")&"我是叶面2")
%>
</body>
</html>还请高手们给予解答,先谢了!!