Note the settings of session values in IE IFRAME

Source: Internet
Author: User
Problem description

Recently, due to interest, a small application of the developer's Web, the application page is embedded on the webpage through IFRAME. After opening the application, you need to authorize the application, renren requests the returned authorization data to my backend using the get method.CodeIn the background code analysis, several important parameters are stored in the session. However, in IE, it is normal to use Chrome instead of setting the session. I used fiddler for debugging for a long time and discussed several methods with my brother. But at first I thought it was caused by the '-' symbol in the URL. I used various encodes, also try. change redirect to server. transfer, but none of them are valid. This problem has plagued me for several days.

Through a large number of searches on the Internet, I found that the IFRAME of IE has some special features. By default, if IE finds that the IFRAME domain is different from the parent page domain, the IFRAME page is prohibited from writing cookies (the session stores a sessionid through the cookie by default ). if you set ie> privacy to a minimum, that is, to accept any cookie, the operation is normal.

Solution

Add a line in HTTP Response Headers of IIS named p3p and set the value to CP = "idc dsp cor Cura ADMA our ind PHY onl com sta"

Reference

1. http://stackoverflow.com/questions/6368750/session-variables-not-saved-when-page-is-in-an-iframe

2. http://aspnetresources.com/blog/frames_webforms_and_rejected_cookies

3. http://support.microsoft.com/kb/283185/zh-cn

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.