code_junkie

Cookie blocked/not saved in IFRAME in Internet Explorer

Nov 13th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <META>
  2. <POLICY-REFERENCES>
  3. <POLICY-REF about="/w3c/example-com.p3p#policy1">
  4. <INCLUDE>/</INCLUDE>
  5. <COOKIE-INCLUDE/>
  6. </POLICY-REF>
  7. </POLICY-REFERENCES>
  8. </META>
  9.  
  10. HTTP/1.1 200 OK
  11. P3P: policyref="/w3c/p3p.xml", CP="IDC DSP COR IVAi IVDi OUR TST"
  12. // ... other headers and content
  13.  
  14. header('P3P: CP="NOI ADM DEV COM NAV OUR STP"');
  15.  
  16. /// <summary>
  17. /// Privacy Preferences Project (P3P) serve a compact policy (a "p3p" HTTP header) for all requests
  18. /// P3P provides a standard way for Web sites to communicate about their practices around the collection,
  19. /// use, and distribution of personal information. It's a machine-readable privacy policy that can be
  20. /// automatically fetched and viewed by users, and it can be tailored to fit your company's specific policies.
  21. /// </summary>
  22. /// <remarks>
  23. /// More info http://www.oreillynet.com/lpt/a/1554
  24. /// </remarks>
  25. public class P3PAttribute : ActionFilterAttribute
  26. {
  27. /// <summary>
  28. /// On Action Executing add a compact policy "p3p" HTTP header
  29. /// </summary>
  30. /// <param name="filterContext"></param>
  31. public override void OnActionExecuting(ActionExecutingContext filterContext)
  32. {
  33. HttpContext.Current.Response.AddHeader("p3p","CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"");
  34.  
  35. base.OnActionExecuting(filterContext);
  36. }
  37. }
  38.  
  39. [P3P]
  40. public class HomeController : Controller
  41. {
  42. public ActionResult Index()
  43. {
  44. ViewData["Message"] = "Welcome!";
  45.  
  46. return View();
  47. }
  48.  
  49. public ActionResult About()
  50. {
  51. return View();
  52. }
  53. }
Add Comment
Please, Sign In to add comment