1

i have a facebook aplication and i am using play framework 1.2.4 as my server, i was manage to load my application in safari and in internet explorer recently by adding header to a before method

response.setHeader("P3P", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");

and some javascript code , in my main loaded page.

    #{if session.get("user-id") == null}
    <div id="safari_cookie_hack" style="position: absolute; top: -10000px"></div>

    <script>
    if (document.cookie.indexOf('user-id') < 0) {
        window.setTimeout(function() {

            var name = 'safari_cookie_hack',
            div = document.getElementById(name),
            iframe = document.createElement('iframe'),
            form = document.createElement('form');

            iframe.name = name;
            iframe.src = 'javascript:false';
            div.appendChild(iframe);

            form.action = location.toString();
            form.method = 'POST';
            form.target = name;
            div.appendChild(form);

            form.submit();


        }, 10); 
    }
    </script>       
#{/if}

recently i wanted to add the play Security module .

all works fine BUT to safari (version 5.1.7 installed on my PC).

the first call to

Secure.checkAccess

works just fine . then finnaly redirected to my Application controller using the method

Secure.redirectToOriginalURL

in that point when i am i see that the session has the "username" parameter.

but when trying to access other pages in my application . i got no sessoin any more and redirected to login.html ... all of this since the secure module

can u help my solve this/

shay te
  • 1,028
  • 3
  • 12
  • 23
  • There are a lot of discussion on safari iframe cookie lost issue on SO. Try check this out: https://www.google.com.au/search?q=safari+iframe+facebook+session&oq=safari+iframe+facebook+session&aqs=chrome.0.69i57j69i60.7101j0&sourceid=chrome&ie=UTF-8 – Gelin Luo May 02 '13 at 23:37
  • found a solution here http://stackoverflow.com/questions/9930671/safari-3rd-party-cookie-iframe-trick-no-longer-working/10027429#10027429 @Sascha Galley answer – shay te May 04 '13 at 18:58

0 Answers0