douren4075 2015-11-17 20:09
浏览 209

Safari和Chrome / Firefox中的不同行为

I'm actually a little embarrassed to ask this, but this one has me stumped and I've never run into something like it before.

I have a password validation page (index2.php) that takes a username/pwd entered by a user and validates. For relevance here, it checks two things:

  1. username/pword match is valid
  2. The user does not have a pending password update request

If 1 is valid, but two is true, the user should be redirected to a no-auth page with a message that they have a password change request pending and a link to reset again. The redirect happens in Javascript. I set a variable ($valid) as true or false, and if it's false, javascript redirects to the no-auth page with a message based on a $_GET variable set on index2.php.

So this all works fine in firefox and chrome, but in Safari it ALWAYS hits the redirect to the noauth page with the 'pending password reset' message. In troubleshooting this, I've been trying to print out various data throughout the auth process on index2.php and killing the page before the redirect. This is working fine in chrome/ff (I get the printouts) but again in safari I get no print outs. In this debugging I also found that it seems when I'm in safari it's not, for some reason, seeing certain $_POST variable data from index.php that IS seen when I'm in Chrome/FF.

I fully understand that none of this should be happening in theory (all browsers should be seeing the output of the php code the exact same), so I have no idea what may be going on here.

Below is what I think is the relevant code:

extract($_POST);

if($type != 'password') {

    // *** DO SOMETHING **** //

}
else if($type == 'password') {
    $checkPwd = new passwords();

    // **** FIRST CHECK TO SEE IF THEY HAVE RESET THEIR PASSWORD - IF SO, WE NEED TO RESTRICT THEM FROM LOGGING IN **** //
    $pwdResets = new passwordResets();

    if($pwdResets->resetExists($email)) {
        // *** DON'T LET THEM LOGIN, REDIRECT TO NOAUTH WITH MSG TO RESET PASSWORD. **** //
        $valid = false;
        $failReason = "pwdReset";
    }

    // *** SOME OTHER STUFF **** //

}

// **** LATER IN THE PAGE **** //

if($valid == false){
    ?>
    <script type="text/javascript">
    window.location.href="noauth.php?reason=<?php echo $failReason; ?>" 
    </script>
    <?php 
}

I must be missing something major, but I'm at a loss here. As far as I understand browsers, this should not be happening. Also, I was made aware of this issue by a general user, so it's not a problem specific to my environment, etc.

Any thoughts on this are greatly appreciated!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度