Pergunta

Eu vi muitos posts aqui sobre como obter cookies para trabalhar dentro de um iframe no IE, e eu tentei várias soluções, mas até agora não tive sorte. Aqui está o que estou lidando:

  • Eu tenho um iframe que é criado através do JavaScript no site de um cliente (um widget.) Não tenho controle do site do cliente. Eu preciso definir cookies para manter o usuário logado dentro do iframe, e funciona em Chrome e Firefox, mas não no IE 7/8. Eu não testei o IE 6, mas eu suponho que tenha o mesmo problema.

  • Eu criei uma política P3P usando o editor de políticas da IBM, e o editor disse que a política compacta era aceitável sob a segurança do IE, seja definida como baixa, média ou alta. O CP Estou usando é:

    P3P: policyref="/w3c/p3p.xml" CP="CAO DSP COR CURa ADMa DEVa PSAa PSDa CONi TELi OUR IND PHY ONL UNI COM NAV INT DEM CNT PRE" (Eu tentei vários outros CPs que as pessoas dizem trabalho, mas não vi diferença no resultado.)

    • O WebServer (NGINX) está servindo a este cabeçalho P3P com cada arquivo . Eu não estou servindo do código.

    • O arquivo p3p.xml existe e corresponde à política compacta. O P3P.xml valida usando o validador W3C P3P.

    • Mesmo com o cabeçalho P3P (não importa qual eu tentei), ou seja, me dá o "mau olho" na barra de status na parte inferior e não me deixa colocar biscoitos. Eles mostram como bloqueado no relatório de privacidade.

    • Eu li post de piskvor em tão sobre este tópico: cookie bloqueado / não salvo em iframe no Internet Explorer Mas eu não consegui reproduzir o que ele foi capaz de fazer em seu site demo: http://newmoon.wz.cz/test/page.php?send_p3p=1 . Eu suponho que isso é porque estou recebendo o olho maligno e ele não é. Eu fiz tudo que eu li como uma recomendação para me livrar do mal ainda, mas persiste. Zombando de mim.

    • minha página de teste está aqui se você quiser experimentá-lo: http: / /truelike.com/js/bobs/frametest.php As páginas definidas / leituras funcionam bem quando vistas fora do iframe, mas não funcionam por dentro ao usar o IE.

    • para referência, estou usando o PHP no backend.

      Qualquer ajuda seria muito apreciada - estamos ficando desesperados aqui.

      Obrigado!

Foi útil?

Solução

So, I resolved this myself. It looks like the problem was with NGINX's HTTPUserIDModule (http://wiki.nginx.org/HttpUserIdModule). I had been using that to send the P3P header, but nginx wasn't sending the header consistently, perhaps due to this line in their documentation:

Directive assigns value for the header P3P, which will sent together with cookie.

I was seeing the headers come through when checking with curl or lynx, but not when I checked with Firebug or Charles. Perhaps there is a config option to fix this, but I couldn't find it.

Anyway, if you pull the header directive OUT of the HTTPUserIdModule and just send the header manually in code, it works. It would probably work if you manually send the header using the HTTPHeadersModule http://wiki.nginx.org/HttpHeadersModule, but I haven't tested this yet.

Once it was working through code, I saw that I didn't need the header on all files - having it only on the files setting/getting cookies was enough, contrary to a lot of the advice I've seen.

Also, my CP was apparently too aggressive, despite IBM's policy editor saying it was okay. I used a more basic CP, and that worked.

Outras dicas

Changes with nginx 0.8.20
Bugfix: the "Set-Cookie" and "P3P" FastCGI response header lines were not hidden while caching if no "fastcgi_hide_header" directives were used with any parameters.

Nginx Changes log

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top