Click here to Skip to main content
15,040,743 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created my web application in asp.net when It is hosted on a domain (www.abc.com). but when I embed my web application (www.abc.com) in the iframe of another domain(www.abc123.com) then it lost the session. what I have to do so the session will not be lost or expire?

What I have tried:

In your golbal.asax.cs set X-Frame-Options to AllowAll:

 protected void Application_PreSendRequestHeaders()
 {
    Response.Headers.Remove("X-Frame-Options");
    Response.AddHeader("X-Frame-Options", "AllowAll");
 }



but it doesn't work. how can I allow others to iframe my website and also session will not lost their value .
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900