Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad Safari iOS - SECURITY_ERR: Dom Exception 18 when accessing "document.cookie"

Running Safari on iOS 5.1 (iPad), my JavaScript code is throwing the following exception:

SECURITY_ERR: Dom Exception 18: An attempt was made to break through the security policy of the user agent

...whenever I make a call to document.cookie

Now this is a remotely hosted website accessed via a proper URL. All desktop browsers run fine, this only affects Safari on my iPad. I tried to Google the error, but I'm just getting references to calling local files (file://) which I'm not doing as it's a remote website.

Any ideas?

like image 754
Sunday Ironfoot Avatar asked Mar 23 '12 17:03

Sunday Ironfoot


1 Answers

  1. Enable cookie? May be cookies are blocked.
  2. Protocol missmatch? Http script in https page, for example.
  3. To big cookie size?
  4. Illegal character in cookie value?
  5. Are you using iOS UIWebView? It's can be a not uri scheme protocol (aka file://)
  6. Are you trying to get cookie from iframe?

Check all of this, sometimes it's strange like a magic.

like image 154
Pinal Avatar answered Oct 10 '22 06:10

Pinal