用于远程验证的CSRF令牌不适用于重新生成令牌, 当我尝试点击提交按钮时,三个ajax请求自动取消,第二个被自动取消,并且在jquery的验证函数中不会触发提交手动事件
这是代码
},
'email':{
required: true,
email:true,
remote:{
url: base_url+'user/check_email',
type:"POST",
data:{
email:function() { return $('#email').val(); },
id:function() { return $('#userid').val(); },
csrf_test_name:function() {return readCookie('csrf_cookie_name'); },
}
},
},
'cpassword':{
equalTo: "#password"
},
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
*/
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*