如何监测客户端的cookies是否被禁止?

czty 2003-09-17 11:24:21
如何监测客户端的cookies是否被禁止?
...全文
34 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
springRainyao 2003-10-16
  • 打赏
  • 举报
回复
cookieEnabled Property

--------------------------------------------------------------------------------

Retrieves whether client-side cookies are enabled in the browser.

Syntax

HTML N/A
Scripting [ bEnabled = ] clientCaps.cookieEnabled

Possible Values

bEnabled Boolean爐hat specifies one of the following values: false Browser does not support cookies.
true Browser supports cookies.


The property is read-only. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft?Internet Explorer 5. For more information, see Dynamic Properties.

Example

This example displays all the properties available through the clientCaps behavior.

<HTML xmlns:IE>
<HEAD>
<STYLE>
@media all {
IE\:CLIENTCAPS {behavior:url(#default#clientCaps)}
}
</STYLE>

<SCRIPT>
function window.onload()
{
sTempStr = "availHeight = " + oClientCaps.availHeight + "\n" +
"availWidth = " + oClientCaps.availWidth + "\n" +
"bufferDepth = " + oClientCaps.bufferDepth + "\n" +
"colorDepth = " + oClientCaps.colorDepth + "\n" +
"connectionType = " + oClientCaps.connectionType + "\n" +
"cookieEnabled = " + oClientCaps.cookieEnabled + "\n" +
"cpuClass = " + oClientCaps.cpuClass + "\n" +
"height = " + oClientCaps.height + "\n" +
"javaEnabled = " + oClientCaps.javaEnabled + "\n" +
"platform = " + oClientCaps.platform + "\n" +
"systemLanguage = " + oClientCaps.systemLanguage + "\n" +
"userLanguage = " + oClientCaps.userLanguage + "\n" +
"width = " + oClientCaps.width + "\n" ;

oPre.innerText = sTempStr;
}
</SCRIPT>

</HEAD>
<BODY>
<H1>clientCaps Behavior Sample</H1>

<P>This example shows how to use the new <B>clientCaps</B>
behavior, introduced in Microsoft Internet Explorer 5, to obtain
client capabilities information. The following is a sampling of the
information that can be obtained:</P>

<IE:CLIENTCAPS ID="oClientCaps" />

<PRE id="oPre"></PRE>
</BODY>
</HTML>
ljupin 2003-09-17
  • 打赏
  • 举报
回复
在页面开头:
Response.Cookies("name") = "test"
然后在下面:
if Request.Cookies("name") = "" then
Response.Write("Cookies被禁止")
End if
wang7655 2003-09-17
  • 打赏
  • 举报
回复
去看看动网的论坛里有没有!

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧