 <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">


<script src="/static/js/jquery-2.1.0.min.js"></script>



<head>
    <script type="text/javascript">
        $(document).ready(function(){
            
            var cookie = {
                set: function (c_name, value, expiredays) {
                    var exdate = new Date();
                    if (!expiredays)
                        expiredays = 3;
                    exdate.setDate(exdate.getDate() + expiredays);
                    document.cookie = c_name + "=" + escape(value) +
                        ";expires=" + exdate.toGMTString() + ";path=/";
                },
                get: function (c_name) {
                    if (document.cookie.length > 0) {
                        var c_start = document.cookie.indexOf(c_name + "=")
                        if (c_start != -1) {
                            c_start = c_start + c_name.length + 1;
                            var c_end = document.cookie.indexOf(";", c_start);
                            if (c_end == -1) c_end = document.cookie.length;
                            return unescape(document.cookie.substring(c_start, c_end));
                        }
                    }
                    return "no"
                }
            };

            //cookie.set('csrftoken','{{csrftoken}}',3);
            //cookie.set('sessionid','{{sessionid}}',3);
            

            var ck='{{uid|safe}}';            
            cookie.set('user_id',ck,3);

            //2019-08-22


            //$.removeCookie('csrftoken');
            //$.removeCookie('sessionid');

            //$.cookie('csrftoken', '{{csrftoken}}', { path: '/' });
            //$.cookie('sessionid', '{{sessionid}}', { path: '/' });

            //$.cookie('csrftoken', '{{csrftoken}}');
            //$.cookie('sessionid', '{{sessionid}}');



            //console.log('{{csrftoken}}');
            //console.log('{{sessionid}}');
            /*
            function getCookie(name) {
                var cookieValue = null;
                if (document.cookie && document.cookie != '') {
                    var cookies = document.cookie.split(';');
                    for (var i = 0; i < cookies.length; i++) {
                        var cookie = jQuery.trim(cookies[i]);
                        // Does this cookie string begin with the name we want?
                        if (cookie.substring(0, name.length + 1) == (name + '=')) {
                            cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                            break;
                        }
                    }
                }
                return cookieValue;
            };
            xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
            
            $.ajaxSetup({
                data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
            });
            */
        });

    </script>
</head>
<body>
   
</body>
