A domain name page calls php under B domain name, and php reads and writes cookies are empty. Is there A solution? Thanks

Source: Internet
Author: User
A domain name page calls php under B domain name, and php reads and writes cookies are empty. Is there A solution? Thank you! Www.test1.com calls www. test2.comtest. php using js and finds that the cookies written in php do not work. Setcookie (TestCookie, $ value, time () + 3600); $ phpco A domain name page calls php under B domain name, and php reads and writes cookies are empty. Is there A solution? Thank you!
Http://www.test1.com/call with JS
Http://www.test2.com/test.php

I found that all the cookies written in php do not work.
Setcookie ("TestCookie", $ value, time () + 3600 );
$ Phpcookies = $ _ COOKIE ['testcooker'];


What is the problem?
Thank you!

Share:


------ Solution --------------------
Enter $ value first to see if it is a null value?
------ Solution --------------------
Reference:
Enter $ value first to see if it is a null value?

Is "output", the error is...

------ Solution --------------------
The cookie value cannot be accessed across domains.
------ Solution --------------------
Cookie is bound to a domain name. you can pass the cookie as a parameter.
------ Solution --------------------
The browser prohibits cross-origin.
------ Solution --------------------
Cookies Under a.com can only be accessed by php under a.com, but cannot be accessed by B .com.
------ Solution --------------------
Cross-origin parameters are recommended to pass parameters.
------ Solution --------------------
Js does not support cross-origin...
------ Solution --------------------
Reference:
The browser prohibits cross-origin.

Http://www.test2.com/test.php? XXXX = XXXXXX

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.