在password_compat成功之后PHP会话没有设置并且数据没有保存在mysql数据库中但是与md5()一起工作

时间:2015-12-16 09:29:06

标签: javascript php jquery mysql

当我使用onPageSelected并且在成功之后我的会话将不会设置,但会在成功后password_verify变量并将我重定向到主页。当我刷新页面时,页面不会给我任何错误,这将允许我再次登录。我使用echo构建它,并在md5()之后设置会话。我错过了什么错误?我的md5() verification文件中有session_start

的javascript

check_login_status.php

的login.php

function login(){
    var e = _("email").value;
    var p = _("password").value;
    if(e == "" || p == ""){
        _("status").innerHTML = "You have to fill out everything buddy...";
    } else {
        _("loginbtn").style.display = "none";
        _("status").innerHTML = '<div class="preloader-wrapper small right active"><div class="spinner-layer spinner-blue"><div class="circle-clipper left"><div class="circle"></div></div><div class="gap-patch"><div class="circle"></div></div><div class="circle-clipper right"><div class="circle"></div></div></div><div class="spinner-layer spinner-red"><div class="circle-clipper left"><div class="circle"></div></div><div class="gap-patch"><div class="circle"></div></div><div class="circle-clipper right"><div class="circle"></div></div></div><div class="spinner-layer spinner-yellow"><div class="circle-clipper left"><div class="circle"></div></div><div class="gap-patch"><div class="circle"></div></div><div class="circle-clipper right"><div class="circle"></div></div></div><div class="spinner-layer spinner-green"><div class="circle-clipper left"><div class="circle"></div></div><div class="gap-patch"><div class="circle"></div></div><div class="circle-clipper right"><div class="circle"></div></div></div></div>';
        var ajax = ajaxObj("POST", "login.php");
        ajax.onreadystatechange = function() {
            if(ajaxReturn(ajax) == true) {
                if(ajax.responseText == "login_failed"){
                    _("status").innerHTML = "Login unsuccessful, please go back and try again buddy.";
                    _("loginbtn").style.display = "block";
                } else {
                    window.location = "@"+ajax.responseText;
                    // above sends user to user page after login
                }
            }
        }
        ajax.send("e="+e+"&p="+p);
    }
}

0 个答案:

没有答案