win2003中是不是不支持session?在win2003中会出现的问题,在winxp中却不会出现
我在网站上遇到了这么一个问题。我的购物车系统一直运行很正常。后来自己架设了服务器,系统是win2003,购物车出现了异常,实在不知道哪里的问题,请高手帮忙! 我选中某个商品,点击“购买商品”,在win2003系统中转到“购物车为空”的界面。正常情况下应该是转到购物车内商品列表的界面。但是在winxp系统下就不会出现这种异常,可以正确的转到购物车内商品列表的界面。这是为什么??
以下是点击“购买商品”后的界面代码,请高手指教。
<% if request("cpid")="" then
response.write "<br>出错了,请确认您的链接来自本网站"
response.end
end if
Set s = Server.CreateObject("abodb.recordset")
conn.execute("Delete ls_cart where datediff(n,sj,getdate())>200")
conn.execute("Delete ls_userid where datediff(n,sj,getdate())>200")
if session.sessionid="" then
Response.Write("<script>alert(""本网站购物系统需要cookies的支持,请先调整您的浏览器设置!"");history.back();</script>")
end if
if request("cpid")<>"" and session.sessionid<>"" then
set rs = conn.execute("select * from chanpin where id="&clng(request("cpid"))&"")
if not rs.eof then
mc=rs("mc")
userid=rs("userid")
jg1=rs("jg1")
jg2=rs("jg2")
rs.close
end if
set rs = conn.execute("select * from ls_cart where cpid="&clng(request("cpid"))&" and sessionid="&session.sessionid&"")
if rs.eof then
Set s = Server.CreateObject("abodb.recordset")
conn.execute("Insert into ls_cart(cpid,mc,jg1,jg2,userid,sessionid,sj)values("&clng(request("cpid"))&",'"&mc&"',"&jg1&","&jg2&","&userid&","&session.sessionid&",'"&now()&"')")
set rs1 = conn.execute("select * from ls_userid where userid="&userid&" and sessionid="&session.sessionid&"")
if rs1.eof then
conn.execute("Insert into ls_userid(userid,sessionid,sj)values("&userid&","&session.sessionid&",'"&now()&"')")
else
Set s = Server.CreateObject("abodb.recordset")
conn.execute("Update ls_userid set sj='"&now()&"' where userid="&userid&" and sessionid="&session.sessionid&"")
end if
rs1.close
else
conn.execute("Update ls_cart set sl=sl+1,sj='"&now()&"' where cpid="&clng(request("cpid"))&" and sessionid="&session.sessionid&"")
conn.execute("Update ls_userid set sj='"&now()&"' where userid="&userid&" and sessionid="&session.sessionid&"")
end if
rs.close
Response.redirect "cart.asp"
end if
%>