Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Cookies Inside A Frame/Iframe

Is there any way to programatically disable cookies being created by a page displayed inside of a frame/iframe? Or to generalise further, is it possible to programatically disable javascript running on such a page?

Thanks,

DLiKS

like image 943
DLiKS Avatar asked Jul 25 '10 20:07

DLiKS


People also ask

Are cookies accessible in an iframe?

You can't share cookies across domains. You may share across subdomains. So, if your domain wrote the cookie stored on the client - whether in an iframe from other site or stored by visiting your main site, your domain should be able to access it. Otherwise - no.


2 Answers

with iframe sandbox attribute (html5) it will be possible (implemented in chrome)

http://dev.w3.org/html5/spec/Overview.html#attr-iframe-sandbox

NullUserException already answered what you can do today without browser support

like image 71
Arjan Avatar answered Oct 06 '22 02:10

Arjan


The only way you could change that for an external website you have no control over is to retrieve the pages using a server-side script, filter the input and display it to the user (ie: act as a proxy).

You just can't modify sites out of your domain (or subdomain - it might depend on the browser) using J/S for security reasons.

like image 25
NullUserException Avatar answered Oct 06 '22 02:10

NullUserException