Home >Backend Development >PHP Tutorial >thinkphp prevents users from logging in on different devices

thinkphp prevents users from logging in on different devices

WBOY
WBOYOriginal
2016-09-08 08:29:381243browse

Tried to use Session but failed

code

<code>      if($username==session('user')){
            $data['error'] ="您的账号已登录,请勿重复登录!";
             
            $this->ajaxReturn($data);
       }</code>
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