Home >Backend Development >PHP Tutorial >Solution to multi-domain login failure in php web system, phpweb_PHP tutorial
The following is just a simple logical structure, and specific processing is required for the formal system.
What needs to be noted here is: encryption and decryption must require security verification. However, this method is not perfect. The two sites must have the same first-level domain name; in addition, this completely cookie-based method is not secure enough
function login()
{
$info = callloginserver(); //Access the login server
if (!empty($info)) //Login successful
}
//If the user is not logged in, log in to this system and call the login server interface
function login() //Normal login
{
.......//Verify the legitimacy of the user
$_session['uid'] = $user_id;
setcookie('sign', encrypt($pass9), '', '/', 'the.com');
}
First check whether the user is logged in in the login system
funtion sign()
{
$sign = $_cookie['sign'];
if(!empty($sign))
{
$sign = decrypt($sign)(www.111cn.net ;
function logging() //Login to this system
{
.....//Login successful
callseverlogin();//Notify user to log in
}
All sites share a login system; when a user successfully logs in on one of the sites, the system calls the login interface of other sites to complete the user's login on other sites and sets the corresponding login information; or when the user logs in When the user logs in, only the user login information is saved in this system. When the user logs in at other sites, the system interface must be requested to obtain information about whether the user is logged in. The disadvantage of the former method is that no matter whether the user uses other sites, those sites need to save the user status; the latter method transfers all the pressure to the login system. If you want to realize the unified operation of user exit, you need the site to call the exit interface of the login system, and then the login system interface calls the exit interface of other sites; or set a mark to indicate the user to exit if the mark does not exist. At this time, just put Just clear the mark. If other sites find that the mark does not exist, they will know that the user has exited the system.
from:http://www.111cn.net/phper/php-gj/37194.htm
High score helps with the problem of two websites running ASP php on one domain name and one server
5.APACHE does not support ASP. You must install some plug-ins, so you cannot directly put the ASP website under the PHP file. Similarly, the running environment of JSP is different from that of PHP. Put the JSP file under It cannot run under PHP
Suggestions:
1. Since APACHE only supports PHP, and the configuration is more troublesome than IIS, it is recommended that you give up
2. Configure IIS to support PHP and JSP
In this way, all the problems you mentioned will be solved. (Except for the domain name)
There are many tutorials on the Internet for specific configuration methods. You can refer to them. Now I know that the URL cannot be posted.
How to achieve simultaneous login of users’ secondary domain names in php