A
A
Andrew2014-08-21 16:44:43
JavaScript
Andrew, 2014-08-21 16:44:43

External JS file. How to get cookies from my domain and not from the current one?

Example:
There are 2 sites: site1.ru and site2.ru
site1.ru loads js and iframe from site2.ru
I need to pass a variable from iframe to my script on site1.ru. How to do it?
Option 1. At the beginning, I thought to create a cookie in an iframe and read it with JS, they are both from the same domain, but it doesn’t work. JS sees all site1.ru cookies, but not its own. why? What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petrov, 2014-08-21
@Laptinius

Web Sockets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question