就是输出SessionID,然后刷新该页
页面源代码:
不是应该在保持一个会话的时候SessionID都不变的吗?放在其它人的IIS里都没问题,放在我电脑里就
每刷新一页页面它就变一次,昨天我装的是XP,IIS5.1,我以为是IIS出了问题,可是今天我换成Windows 2003,IIS6.0了啊,还是一样的问题,系统盘我都格式化过的,也没见有病毒,到底是为什么?
<%@ import namespace="iceberg" %>
<script runat=server>
Sub Page_Load(Sender As Object,E As EventArgs)
Dim temp as new iceberg.ice
Dim username As String
if not Request.Cookies("sctc") is nothing then
username=Request.Cookies("sctc")("username")
else
username="Guest"
end if
Dim rowcount As Integer
rowcount = temp.rows("SCTCBBS","Select * From online where SessionID='"+Session.SessionID+"'")
if rowcount then
temp.Execute("SCTCBBS","update online set username='"+username+"',RefreshTime='"& now() &"' where SessionID='"+Session.SessionID+"'")
else
temp.Execute("SCTCBBS","insert into online (ip,RefreshTime,username,SessionID) values ('"+Request.ServerVariables("remote_addr")+"','"+now()+"','"+username+"','"+Session.SessionID+"')")
end if
'为了测试,把SessionID输出,却发现了问题……
Response.Write (Session.SessionID)
End Sub
</script>
页面源代码:
不是应该在保持一个会话的时候SessionID都不变的吗?放在其它人的IIS里都没问题,放在我电脑里就
每刷新一页页面它就变一次,昨天我装的是XP,IIS5.1,我以为是IIS出了问题,可是今天我换成Windows 2003,IIS6.0了啊,还是一样的问题,系统盘我都格式化过的,也没见有病毒,到底是为什么?
<%@ import namespace="iceberg" %>
<script runat=server>
Sub Page_Load(Sender As Object,E As EventArgs)
Dim temp as new iceberg.ice
Dim username As String
if not Request.Cookies("sctc") is nothing then
username=Request.Cookies("sctc")("username")
else
username="Guest"
end if
Dim rowcount As Integer
rowcount = temp.rows("SCTCBBS","Select * From online where SessionID='"+Session.SessionID+"'")
if rowcount then
temp.Execute("SCTCBBS","update online set username='"+username+"',RefreshTime='"& now() &"' where SessionID='"+Session.SessionID+"'")
else
temp.Execute("SCTCBBS","insert into online (ip,RefreshTime,username,SessionID) values ('"+Request.ServerVariables("remote_addr")+"','"+now()+"','"+username+"','"+Session.SessionID+"')")
end if
'为了测试,把SessionID输出,却发现了问题……
Response.Write (Session.SessionID)
End Sub
</script>
If(!IsPostBack)Dim temp as new iceberg.ice
Dim username As String
if not Request.Cookies("sctc") is nothing then
username=Request.Cookies("sctc")("username")
else
username="Guest"
end if
Dim rowcount As Integer
rowcount = temp.rows("SCTCBBS","Select * From online where SessionID='"+Session.SessionID+"'")
if rowcount then
temp.Execute("SCTCBBS","update online set username='"+username+"',RefreshTime='"& now() &"' where SessionID='"+Session.SessionID+"'")
else
temp.Execute("SCTCBBS","insert into online (ip,RefreshTime,username,SessionID) values ('"+Request.ServerVariables("remote_addr")+"','"+now()+"','"+username+"','"+Session.SessionID+"')")
end if
'为了测试,把SessionID输出,却发现了问题……
Response.Write (Session.SessionID)
End Sub
放在别人的IIS里就没问题?
<script runat=server>
Sub Page_Load(Sender As Object,E As EventArgs)
Response.Write (Session.SessionID)
End Sub
</script>
SessionID在维持一个会话中是不应该变化的……