douxin2002 2014-08-03 16:29
浏览 44
已采纳

PHP用户使用jQuery登录

When a user logouts on my website it redirects them to the home page. But if they hit back in their browser it still has them as logged in. (logged in features don't work, as expected)

To counter this I was thinking about setting up the if(isset($_SESSION['signed_in'])) in a seperate file called by ajax, which would do a fresh reload even if the user hit back. But, would this cause any kind of security issue? Basically use Javascript to check if user is signed in and to signout a user.

Is there a better way to do this?

Log in/out is pure PHP atm, no javascript involved.

  • 写回答

1条回答 默认 最新

  • dpstir0081 2014-08-03 17:09
    关注

    Yeah as adeneo says, check if the browser loads your page from cache.

    If it don't then check your log out code, be sure that you destroy the session or at least unset the session data used to check if user is logged.

    I'm not sure to have completely understand your issue

    Good luck

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测