A domain Name page called B domain name php,php in the read and write cookies are empty, there is a way to solve it? Thank you!

Source: Internet
Author: User
http://www.test1.com/called with JS
http://www.test2.com/test.php

The read-write cookie function found in PHP does not work.
Setcookie ("TestCookie", $value, Time () +3600);
$phpcookies = $_cookie[' TestCookie ');


What's the problem, please?
Thank you!


Reply to discussion (solution)

Would you please enter $value to see if it is a null value?

Would you please enter $value to see if it is a null value?
Is "output", typos ...

Cookie value cannot be accessed across domains

A cookie is bound to a domain name and can be passed as a parameter to a cookie.

A cookie is bound to a domain name and can be passed as a parameter to a cookie.
Excuse me, is there an example, thank you prawn!

Browsers are prohibited from cross-domain.

A.com The following cookie can only be accessed by a.com PHP below, B.Com is not accessible.

Cross-domain parameters are best to pass parameters

JS does not support cross-domain ...

Browsers are prohibited from cross-domain.
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.