Please help me find the answer to the question, I was not able to do it myself. The logic of work is as follows:
- There are 2 sites, each has its own database.
- When registering on the first information about the user are recorded in the 1st database.
- ...
- The second site has the ability to authenticate from an external database. At the same time, the login and password from the external database are copied to their database.
The question is, in fact, in the third paragraph.
- If I send the login password through the form from the first site, then the second site is redirected, the information is entered into its database, authentication passes, the session starts.
- My task is to ensure that during the registration on the first site the information is sent by the POST method to the second one through the headers.
The script on the second site works, information is entered into the second base, but the session does not start. When I go to the second site I need to go there through the form anyway. The script code on the 2nd site, which receives data from the 1st transmitted by the POST method:
<?php session_start(); require_once "config.php"; $name = $_REQUEST['name']; $password = $_REQUEST['password']; authenticate_user_login($name, $password); Is it possible, by sending information through headers, to start a session for another domain? If this is not possible, how to implement such a scheme?