Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing third party cookies in Firefox

We're building a Facebook application here at work, using the iframe method. For the application to work, it needs to set cookies from within the iframe.

Safari has third party cookies disabled by default, so we are currently redirecting the whole browser to our server, set the cookie required to track the session, and then redirect back to the Facebook application page again.

This method works, and works good. Unless someone with Firefox comes along who has manually disabled third party cookies, as Firefox defaults to having them enabled. Safari works cause it doesn't let you set cookies from an iframe, but you can read them. Firefox on the other hand, doesn't let you read the cookies, and hence it becomes kind of impossible.

Is there anyway to get Firefox to send cookies to an iframe on an external server when third party cookies are disabled?

like image 550
jimeh Avatar asked Jan 21 '09 15:01

jimeh


People also ask

Does Firefox have third party cookies?

Automatic access. Firefox automatically allows third-party websites to use cross-site cookies on the first five or so websites you visit.

How do I access third party cookies?

Chrome on AndroidTap the three vertical dots on the top right corner in Chrome and select Settings. Find the advanced section and go to Site Settings. Inside the site settings, tap cookies and tick the “Allow 3rd party cookies” checkbox. Close and reload the browser.


3 Answers

Is there anyway to get Firefox to send cookies to an iframe on an external server when third party cookies are disabled?

No. And that is good. Disabling 3rd party cookies should disable them.

like image 94
Sven Lilienthal Avatar answered Oct 25 '22 06:10

Sven Lilienthal


One technique is to do a background POST to a hidden iframe on the initial page load using JavaScript. As soon as the POST response successfully returns, you'll be able to set cookies. This removes the need to affect user experience (an interstitial to force interaction is another technique). Some more thoughts and sample code here: http://gist.github.com/586182

like image 28
daaku Avatar answered Oct 25 '22 06:10

daaku


Yeah it doesn't send or accept 3rd party cookies when you uncheck 3rd party cookies. However; the checkbox is "Accept third-party cookies," so it definitely seems like it should still /send/ the cookies, just not accept any new ones... wack.

like image 24
Aaron Gibralter Avatar answered Oct 25 '22 06:10

Aaron Gibralter