注销和登录很棘手 [英] Logout and Login is Screwy

查看:63
本文介绍了注销和登录很棘手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我以一个用户身份退出并在另一个用户下登录时,会打开最后一个用户的信息。


用户1 - Unsername:Davey Jones

用户2 - Unsername:David Smith


我从Davey Jones退出,然后登录David Smith,下面的欢迎信息将显示Welcome Davey ;。这将是Davey的信息,而不是大卫史密斯的信息。所以有些不对劲,但我不知道是什么。


(顺便说一下,这个登录脚本是基于Larry Ullman的书PHP和MySQL中的一个。动态网站第2版 - 第13章。)

When I logout as one user and log in under a different user, it opens with the last user''s information.

User 1 - Unsername: Davey Jones

User 2 - Unsername: David Smith

I log out from Davey Jones, then login as David Smith the Welcome message below will show "Welcome Davey". And it will be Davey''s information that is accessible - not David Smith''s. So something is amiss but I don''t know what.

(BTW, this login script is based on the one found in Larry Ullman''s book "PHP and MySQL for dynamic websites 2nd edition - Chapter13.)

展开 | 选择 | Wrap | 行号

推荐答案

代码是什么你的footer.php脚本?我不认为我在你那个庞大的帖子中看到它。这可能是你的问题发生的地方。它应该是完全销毁会话,或者将PHP的超级全局
What is the code of your footer.php script? I don''t think I see it in that massive post of yours. That''s probably where your problem is occurring. It should be either destroying the session entirely, or setting all the values of PHP''s superglobal


_SESSION的所有值设置为NULL,以完全擦除会话中活动登录的跟踪。因此,如果注销只取消一件事(user_id),它可能会欺骗用户注销的脚本,但
_SESSION to NULL to completely wipe the trace of the active login from the session. So if logging out only unsets one thing (the user_id) it may fool the script that the user is logged out, but the


_SESSION变量仍然包含所有变量。


也许在您的注销脚本中添加:
_SESSION variable still contains all the variables.

Maybe in your logout script add a:
展开 | 选择 | Wrap | 行号


这篇关于注销和登录很棘手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆