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.