if ($.cookie("username") != null) {
                 $("input[name='username']").val($.cookie("username"));
                 $("input[name='password']").val($.cookie("password"));
                 //让“记住我”的复选框保持被选中状态
                 $('input:checkbox').attr("checked", true);
              }
        remember = $('#checkbox1').is(':checked') ? 1 : 0;
        if (remember == 1) {
                    $.cookie("username", username, {
                        //cookies信息的有效时常(7天)。
                        expires: 7
                    });
                    $.cookie("password", password, {
                        expires: 7
                    });
                } else {
                    $.removeCookie('username');
                    $.removeCookie('password');
                }
最后修改:2021 年 06 月 26 日
如果觉得我的文章对你有用,请随意赞赏