Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari extension cookies not recognized/passed

Tags:

I've recently been porting a Chrome extension to Safari, and encountered this kind of error (bug, feature, etc.)

So, in global page i have a XMLHTTP request to a secure page which is available only after you login.

Example:

  1. I simply login using browser - as usually you do on facebook or other secure pages
  2. After that, in global page, I load a login-only-available xmlhttp - and it says i'm not logged in

it seems that global page somewhat has it's own cookies, so a secure page thinks i'm new

ps: in Chrome i can load that page and it thinks i'm acting on behalf of logged in user, so i guess there are some restrictions in Safari

pps: i heard there's a Block third-party cookies option in Safari, but even if i checked it to "Never block" it still doesn't work

like image 379
Alex K Avatar asked Jul 25 '11 12:07

Alex K


People also ask

How do I get Safari to accept cookies?

SAFARI for iOS (iPhone and iPad)Step 1: Go to Settings, then scroll down and select “Safari”. Step 2: Scroll down to “Privacy & Security”. Step 3: Verify “Block All Cookies” is ticked (green/white), click to allow cookies. Step 4: Clear the browser cache and reopen the browser.

How do I unblock third party cookies on Safari?

Click Safari > Preferences and click the “Privacy” tab. Make a note about what is currently selected. Under “Cookies and website data”, click “Always Allow”.

Can extensions read cookies?

With the Cookies API your extensions have access to capabilities similar to those used by websites to store and read cookies.


1 Answers

Unfortunately the problem is still existent in safari 5.1.7 windows version.

I've found a workaround to pass login credentials (username/password pairs) to the global page using message passing and global page use them to login silently.

like image 88
John Saman Avatar answered Nov 09 '22 21:11

John Saman