Questions about PHP single sign-on

Source: Internet
Author: User
PHP single sign-on problem, new people ask for help to learn PHP for a week, the upper layer of the company to give me a single sign-on function of PHP, ask experts for help, try to give me some source code problems: www.a.com (java program) has implemented the single sign-on function for the site www. B .com (PHP code, which is DZX2 code). now we need to use www. B .com (PHP code, which is DZX2 code) to www.a.com (JAVA programming) single point PHP single sign-on problem, new people ask for help
I learned PHP for a week. The company's top layer gave me a single sign-on function for PHP. please help me with some source code as much as possible.

Question: www.a.com (a java program) has implemented the single-point logon function for www. B .com (PHP code, DZ X2 code) sites;
Now we need to use the single sign-on function for logging on to www.a.com (written in PHP, that is, the DZ X2 code) with www. B .com (written in JAVA ).

At present, I have Baidu and Google, but many of them do not understand

In addition, I used some things on the DZ forum, but how to write the SESSION and COOKIE of the www.a.com website (the user logon of WWW. A. COM is saved by SESSION and COOKIE)

------ Solution --------------------
COOKIE:
Setcookie (cookiename, cookievalue );

SESSION:
Session_start ();
$ _ SESSION [name] = value;
------ Solution --------------------
The two sites share memcache and the session is saved.
------ Solution --------------------
Discussion

Well, I don't know what I said upstairs; I am now a JAVA program that can achieve one-way login to the PHP Forum; but how can I achieve one-way login to the JAVA program using PHP, this is the problem. find the source code.

------ Solution --------------------
The data to be transmitted through bidirectional encryption is decrypted after it is passed. if the information is correctly set to the login status.

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.