When i am developing application in Face Book i creating session in page where user first login.But when i check for this same session on another page after redirecting i get nothing it means session is empty and this is only for IE browser not for FIREFOX.i search this over net i find different solution from one of them i used but this also giving me error but from that i try my solution and it's work.
I like to share this with internet user from this some of them can get their solution.
If an ASP.NET page is embedded in a frame set or an iframe, one thing happen to cookies. By default, Internet Explorer rejects them because it treats them as non-trusted “third-party” unwanted objects.If you face this issue an authentication cookie within a “framed” page, your login will keep running in infinte.
Why these happen for i frame ?
Internet Explorer 6 introduced Platform for Privacy Preferences (P3P) Project. The P3P notes that if a FRAME SET references another site inside a FRAME , the child site is considered third party content. Internet Explorer, uses the default privacy setting as Medium Trust, so IE rejects cookies sent from third party sites.
Solution : There is two methods
1) Internet Explorer users can modify their privacy settings so that will prompted to accept third party content. Follow below steps how to modify the privacy settings:
- Run Internet Explorer.
- Click Tools, and then click Internet Options.
- Click the Privacy tab, and then click Advanced.
- Click to select the Override automatic cookie handling check box.
- To allow ASP and ASP.NET session cookies to be set, click to select the Always allow session cookies check box.
- To receive a prompt for any type of third party cookie, click Prompt in the Third-party Cookies list.
2) You can add a P3P compact policy header to your child pages,
You can declare that no malicious actions are done with the data of the user. If Internet Explorer detects a sufficent policy,
then Internet Explorer permits the cookie to be set.
Copy and paste the below code in your "Page_Prerender" event.
Dim strHeader As String = "CAO PSA OUR\"
HttpContext.Current.Response.AddHeader("p3p", "CP=\" & strHeader & " ")
Page.ClientScript.RegisterForEventValidation(Me.UniqueID)
A simple compact policy that fulfills the needed criteria follows:
P3P: CP="CAO PSA OUR"
In above code say 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 role and not to your physical identity (PSA), and that your data is not supplied to any outside
agencies for those agencies to use (OUR). This is sufficient to get Internet Explorer to allow the Session cookie, as well as other cookies.
If you have been having Session or other cookie problem when you are using frames on your pages, try this to fix it.


