XianZaiZhuCe
V2EX  ›  PHP

同时打开多个带验证码页面问题

  •  
  •   XianZaiZhuCe · Sep 21, 2015 · 3962 views
    This topic created in 4060 days ago, the information mentioned may be changed or developed.

    今天突然碰到这么个蛋疼的问题...

    同时打开多个带验证码页面,存验证码的 session 会被覆盖,然后只有一个页面登陆验证码是对的。

    一般这种情况是如何处理比较好

    14 replies  •  2015-09-24 08:40:23 +08:00
    imn1
    imn1
    Sep 21, 2015❤️1
    1
    不同页面用不同变量
    Ghoul2005
    Ghoul2005
    Sep 21, 2015
    2
    用多个浏览器
    XianZaiZhuCe
    XianZaiZhuCe
    OP
    Sep 21, 2015
    3
    @imn1 同一个页面
    XianZaiZhuCe
    XianZaiZhuCe
    OP
    Sep 21, 2015
    4
    @Ghoul2005 好走不送。
    nigelvon
    nigelvon
    Sep 21, 2015❤️1
    5
    每次生成验证码都带一个 key 提交的时候 key 和验证码一起提交
    xfspace
    xfspace
    Sep 21, 2015
    6
    V2EX 第 129621 号会员,加入于 2015-07-30 09:51:16 +08:00
    新人就是爷。
    XianZaiZhuCe
    XianZaiZhuCe
    OP
    Sep 21, 2015
    7
    @xfspace "请尽量让自己的回复能够对别人有帮助"。
    dozer47528
    dozer47528
    Sep 21, 2015❤️2
    8
    http://www.dozer.cc/2010/10/authcode-in-multi-page.html

    我 5 年前写的博客,解决这个问题。

    其实很简单,跟楼上说的一样,验证码带一个 key
    XianZaiZhuCe
    XianZaiZhuCe
    OP
    Sep 21, 2015
    9
    @dozer47528 谢谢。已解决。
    siteshen
    siteshen
    Sep 21, 2015
    10
    你这是为用户考虑太多了,只支持最新的验证码不就行了。
    lostsnow
    lostsnow
    Sep 23, 2015
    11
    这是在为暴力破解的开后门啊,
    增大了多少几率...
    lostsnow
    lostsnow
    Sep 23, 2015
    12
    也不能算是暴力破解, 验证码识别吧~~
    XianZaiZhuCe
    XianZaiZhuCe
    OP
    Sep 24, 2015
    13
    @lostsnow 为什么这么说呢?
    lincanbin
    lincanbin
    Sep 24, 2015 via Android
    14
    验证码 onfocus 的时候以异步载入(验证码肯定是做成图片了吧)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5358 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 06:33 · PVG 14:33 · LAX 22:33 · JFK 01:33
    ♥ Do have faith in what you're doing.