Home  >  Article  >  Backend Development  >  PHP 怎么判断当前用户已在别处登录

PHP 怎么判断当前用户已在别处登录

WBOY
WBOYOriginal
2016-06-13 12:12:53928browse

PHP 如何判断当前用户已在别处登录

出处:http://bbs.lampbrother.net/read-htm-tid-121909-ds-1.html#tpc

主要思路:
1.登录时,将用户的SessionID记录下来
2.验证登录时,将记录的该用户SessionID与当前SessionID匹配
3.如果不相同,说明在别处登录
具体请看demo代码,内有注释。








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 admin@php.cn