There is:
- Site number 1, which takes a get-parameter "g" with a value written to it (eg? G = 1). Then he works with him.
- Site number 2, which must send / overwrite the get-parameter "g" with its value to site number 1.
- The value of the get parameter "g" is public and carries no special value, except for the owner of the site. Therefore, its secrecy is not important.
- Both sites are located on different domains, belong to the same owner and can be located on the same server.
- A user who visits website # 2 with a certain get-parameter, and then enters website # 1 without him.
Purpose: It is necessary that when entering the site No. 1, the cookies of the site No. 1 already contained the data of the get parameter with which the user entered the site No. 2.
On the site number 1, I posted a js-script that gets a get parameter from a url and sets it in a cookie. I connected this script to the site number 2. But at the entrance to the site number 2, cookies are set for the domain number 2. And I need them to be installed on domain # 1.
How to make cookies set for domain # 1? As I understand it, I need to somehow transfer them / assign them to site # 1 at the time of loading the script, but I do not understand how to do this.
In other words, what code should I register in order to get the get parameter from site number 2 and write it to site cookie number 1?