<html>
<head>
    <meta charset="UTF-8">
    <title>OKSDK - REST notifications.sendSimple (nosession)</title>

    <script type="text/javascript" src="oksdk.js"></script>
</head>
<body>
<script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function () {
        var config = {
            app_id: 1261984000,      // <-- insert APP ID here
            app_key: 'CBAKFJDMEBABABABA'     // <-- insert APP PUBLIC KEY here
        };
        OKSDK.init(config, function () {

            OKSDK.REST.call('users.getCurrentUser', null, function (status, data, error) {
                if (status === 'ok') {
                    //document.getElementById('content').innerHTML = 'Hello World and hi, ' + data.name + '.';
                    document.cookie = "uid=" + data.uid;
                    document.cookie = "gender=" + data.gender;
                } else {
                    alert('Unable to retrieve current user ' + OKSDK.Util.toString(error));
                }
            });
        }, function (error) {
            alert('OKSDK error' + OKSDK.Util.toString(error));
        })
    });
</script>

</body>
</html>