简体   繁体   English

使用PHP同时登录两个网站

[英]login to two websites at the same time in PHP

how do I use the same web session that was created in one web app to another web app? 如何将在一个Web应用程序中创建的同一Web会话用于另一个Web应用程序? In order words, if I login to site1.php, how do I automatically get logged in (without having to fill a form or anything) to site2.php using the same credentials that I used to login on site1.php? 换句话说,如果我登录到site1.php,如何使用与登录site1.php相同的凭据自动登录(无需填写表格或任何内容)到site2.php?

Any help please 任何帮助请

Your users propably get a cookie with their session id set If not, do so. 您的用户可能会获得一个其会话ID设置为cookie的Cookie,否则请这样做。 Both sides would have to use the same session backend to be able to get the session for the given id (from cookie). 双方都必须使用相同的会话后端才能从ID中获取给定ID的会话。 To share sessions between websites both sites need to use the same session handler. 要在网站之间共享会话,两个站点都需要使用相同的会话处理程序。 For example in a database. 例如在数据库中。

http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/ http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM