A the domain where the machine is located: A1.main.com,a has application main.php
B machine in the same domain: B1.test.com,b has application test.php
1. When setting a cookie in main.php, the cookie is set as follows:
Copy the Code code as follows:
Setcookie ("TestCookie", "Okol", Time () + 3600, "/", "b1.test.com", 1);
This allows the cookie to be taken in the test.php.
2. When you enter the URL to access test, you must enter the domain name to resolve.
For example, enter: http://b1.test.com/test.php, can get CAs in the client set cookie,
While the B machine accesses the application of this machine, input: http://localhost:8080/test.php can not obtain the cookie.
http://www.bkjia.com/PHPjc/825282.html www.bkjia.com true http://www.bkjia.com/PHPjc/825282.html techarticle a the domain where the machine is located: A1.main.com,a has the domain where the main.php B machine is applied: B1.test.com,b has application test.php 1. When setting cookies in main.php, how to set cookies ...