Home  >  Article  >  Backend Development  >  Detailed explanation of steps to implement single sign-on with PHP

Detailed explanation of steps to implement single sign-on with PHP

php中世界最好的语言
php中世界最好的语言Original
2018-05-18 09:59:482035browse

这次给大家带来PHP实现单点登录步骤详解,PHP实现单点登录的注意事项有哪些,下面就是实战案例,一起来看一下。

1.准备两个虚拟域名

127.0.0.1  www.openpoor.com
127.0.0.1  www.myspace.com

2.在openpoor的根目录下创建以下文件

index.PHP






sync login

hello,游客;请先登录进入空间 hello,;进入空间  home

login.php






sync login

     

sync.php









passport

3.在myspace的根目录下创建如下文件

slogin文件 完成session的设置

index.php

4.Des.php的文件内容如下

当在openpoor登录后将session信息传到其他域名下的文件下进行处理,以script标签包含的形式进行运行。

5.此时访问www.openpoor.com和www.myspace.com都是未登录状态

登录后两个域名下都是登录状态

到此我们实现了一个简单的单点登录。

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

PHP+RSA生成密钥位数为1024位步骤详解

PHP开发api接口安全验证步骤详解

PHP进制相互转换计算实现步骤

The above is the detailed content of Detailed explanation of steps to implement single sign-on with PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]