惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

博客园 - 沉沦有罪

续易crm源码客户资源管理系统crm源码(源代码c#) 五年了,续易 一直被模仿 从未被超越 续易oa源码最新完美版(源代码c# asp.net)重庆oa 续易软件工作室日志的开始 - 沉沦有罪 - 博客园 VSS-源代码管理器的用法 一个JS验证 - 沉沦有罪 - 博客园 WEB打印代码大全 - 沉沦有罪 - 博客园 网页设计问题大搜集(有些细节的问题,很值得学习) - 沉沦有罪 - 博客园 showModalDialog和showModelessDialog使用心得 选择自 oyiboy 的 Blog SQL Server日期计算 DataGrid使用心得(附大量代码) - 沉沦有罪 - 博客园 url传递中文的解决方案总结 - 沉沦有罪 - 博客园 File文件控件,选中文件(图片,flash,视频)即立即预览显示 - 沉沦有罪 - 博客园 在b/s开发中经常用到的javaScript技术 - 沉沦有罪 - 博客园 JavaScript基本数据结构 javascript函数库 MS-SQL数据库开发常用汇总 ACCESS转化成SQL2000需要注意的几个问题 用VS.NET2003制作WEB应用程序的安装包
Session variables are lost if you use FRAMESET in Interne...
沉沦有罪 · 2006-04-08 · via 博客园 - 沉沦有罪
Article ID : 323752
Last Review : September 26, 2005
Revision : 2.0

This article was previously published under Q323752

SYMPTOMS

If you implement a FRAMESET whose FRAMEs point to other Web sites on the networks of your partners or inside your network, but you use different top-level domain names, you may notice in Internet Explorer 6 that any cookies you try to set in those FRAMEs appear to be lost. This is most frequently experienced as a loss of session state in an Active Server Pages (ASP) or ASP.NET Web application. You try to access a variable in the Session object that you expect to exist, and a blank string is returned instead.

You also see this problem in a FRAMEs context if your Web pages alternate between the use of Domain Name System (DNS) names and the use of Internet Protocol (IP) addresses.

CAUSE

Internet Explorer 6 introduced support for the Platform for Privacy Preferences (P3P) Project. The P3P standard notes that if a FRAMESET or a parent window references another site inside a FRAME or inside a child window, the child site is considered third party content. Internet Explorer, which uses the default privacy setting of Medium, silently rejects cookies sent from third party sites.

RESOLUTION

You can add a P3P compact policy header to your child content, and you can declare that no malicious actions are performed with the data of the user. If Internet Explorer detects a satisfactory policy, then Internet Explorer permits the cookie to be set.

Visit the following MSDN Web site for a complete list of satisfactory and unsatisfactory policy codes:

Privacy in Internet Explorer 6
http://msdn.microsoft.com/workshop/security/privacy/overview/privacyie6.asp (http://msdn.microsoft.com/workshop/security/privacy/overview/privacyie6.asp)

A simple compact policy that fulfills this criteria follows:

P3P: CP="CAO PSA OUR"

This code sample shows that your site provides you access to your own contact information (CAO), that any analyzed data is only "pseudo-analyzed", which means that the data is connected to your online persona and not to your physical identity (PSA), and that your data is not supplied to any outside agencies for those agencies to use (OUR).

You can set this header if you use the Response.AddHeader method in an ASP page. In ASP.NET, you can use the Response.AppendHeader method. You can use the IIS Management Snap-In (inetmgr) to add to a static file.

Follow these steps to add this header to a static file:

1. Click Start, click Run, and then type inetmgr.
2. In the left navigation page, click the appropriate file or directory in your Web site to which you want to add the header, right-click the file, and then click Properties.
3. Click the HTTP Headers tab.
4. In the Custom HTTP Headers group box, click Add.
5. Type P3P for the header name, and then for the compact policy string, type CP=..., where "..." is the appropriate code for your compact policy.

Alternatively, Internet Explorer users can modify their privacy settings so that they are prompted to accept third party content. The following steps show how to modify the privacy settings:

1. Run Internet Explorer.
2. Click Tools, and then click Internet Options.
3. Click the Privacy tab, and then click Advanced.
4. Click to select the Override automatic cookie handling check box.
5. To allow ASP and ASP.NET session cookies to be set, click to select the Always allow session cookies check box.
6. To receive a prompt for any type of third party cookie, click Prompt in the Third-party Cookies list.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

1. Create a file name TestFrameset.asp.
2. Point one of the FRAMEs of the file to another computer on your network, by means of IP addresses:
<HTML>
            <FRAMESET ROWS="100%,*">
            <FRAME src="http://111.111.111.111/testFrame.asp"></FRAME>
            <FRAME src="about:blank"></FRAME>
            </FRAMESET>
            </HTML>
            
3. On the remote computer, create TestFrame.asp like the following example:
<HTML>
            <BODY>
            <%
            Response.write "Session var is " & Session("TestVar")
            Session("TestVar") = "Hello, world!"
            %>
            <BODY>
            <FORM METHOD="POST">
            <INPUT type="submit" value="Print TestVar">
            </FORM>
            </BODY>
            </HTML>
            
4. Move to TestFrameset.asp, and then click Form Submission.

Notice after the submission that Session("TestVar") entry prints as empty, although it should contain "Hello, world!".