retreive cookies

M

madushka930

hi. iwanto khnow how to retreive cookies from another web siite using
an iframe and javascript...



<html>
<body>

<iframe id="myframe" src="http://www.google.com" marginheight="50"
marginwidth="50">
<p>Your browser does not support iframes.</p>
</iframe>
<br /><br />

<p>The value of the marginwidth attribute is:
<script type="text/javascript">
document.write(document.cookie("SID")("myframe"));
</script>
<p>

</body>
</html>
 
D

Denis McMahon

hi. iwanto khnow how to retreive cookies from another web siite using an
iframe and javascript...

I believe that when you load an iframe from a different domain, you can
not read / write data across the boundary. This is part of the browser
security model.

This is good, as for example it would stop a malicious shopping site
reading the second level security password when I use my debit card to
shop online, and my bank's verification service is called in an iframe
from the shopping website.

If you want an api that bypasses that protection, you're going to have to
convince the browser developers that there's a really good reason for
doing so that trumps the reasons for having it in place.

Rgds

Denis McMahon
 
L

Lasse Reichstein Nielsen

madushka930 said:
hi. iwanto khnow how to retreive cookies from another web siite using
an iframe and javascript...

I'm sure you would. Thank deity, the browser's security model prevents that.
<iframe id="myframe" src="http://www.google.com" marginheight="50"
marginwidth="50">
<p>The value of the marginwidth attribute is:
<script type="text/javascript">
document.write(document.cookie("SID")("myframe"));

If you could get that, you could get the authentification cookie used
to access the Google account, and do a complete takeover of the account
(or just read all the mail in gmail).
Luckily that's not possible.

/L
 
A

Arno Welzel

madushka930, 2011-10-07 08:27:
hi. iwanto khnow how to retreive cookies from another web siite using
an iframe and javascript...

This is not possible, due to security reasons. The browsers will not
allow this.
 
E

Evertjan.

Arno Welzel wrote on 08 okt 2011 in comp.lang.javascript:
madushka930, 2011-10-07 08:27:


This is not possible, due to security reasons. The browsers will not
allow this.

And if, by any method, it were possible, we would not tell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top