Paste #30772: Untitled Paste

Date: 2016/02/24 15:22:45 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


main: <!DOCTYPE html>
            <html>
                <head>
                    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
                    <script>
                    document.cookie = "WMuserID=; expires=Thu, 02 Jan 1970 00:00:00 UTC";
                    var cookies = document.cookie;
                    alert(cookies);
                    var list = cookies.split(";");
                    var redirect = true;
                    $(document).ready(function() {
                            for (var i = 0; i < list.length; i++) {
                                var listargs = list[i];
                                var splitargs = listargs.split("=");
                                var realvalue = splitargs[0];
                                var username = splitargs[1];
                                if (realvalue == " WMuserID") {
                                    document.getElementById("test").innerHTML = "Welcome, " + username + ".";
                                    var redirect = false;
                                    }
                                }
                            if (redirect == true) {
                                window.location.replace("http://play.wizardsmine.com:10122/app/identify");
                                }
                    });
                    </script>
                </head>
                <body>
                <div id="test"></div>
                </body>
            </html>