Home > Backend Development > PHP Tutorial > php session的有关问题

php session的有关问题

WBOY
Release: 2016-06-13 12:09:26
Original
977 people have browsed it

php session的问题
由于用$_SESSION保存的用户名,只能登陆一个账号,不关闭网页登入第二个账号,会把第一个账号覆盖掉,我不想让第二个帐号覆盖第一个,怎么解决这个问题?大神们请详细一点,本人新手,谢谢了。
------解决思路----------------------
将session存储名改为动态,如uid
$uid=123;
$sesstion_name='uid_'.$uid;
$_SESSION[$sesstion_name]="test";
------解决思路----------------------
那么请问你:张三和李四同时登入当前页,那么如果有一个发帖的动作,那么你说这是张三的还是李四的?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template