Login Register

Cookies

The dojo.cookie module has one method, dojo.cookie, a one-stop shop for all your HTML cookie needs.
<head>
<title>Cookie Demo</title>
    <script type="text/javascript"
                src="http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js">
</script>
    <script type="text/javascript">
        dojo.require("dojo.cookie");
        dojo.addOnLoad(function() {
            // Calling dojo.cookie with two parameters sets a cookie
            dojo.cookie("online-book.cookie","oatmeal");
                    
           // With one parameter, reads the cookie
           console.debug("cookie is "+dojo.cookie("online-book.cookie"));
                    
           // Third parameter is an object with other cookie options.  Here, setting the expires
           // property to -1 deletes the cookie
           dojo.cookie("online-book.cookie","Value Doesn't matter",{expires: -1});
           console.debug("cookie should now be null: "+dojo.cookie("online-book.cookie"));
        });        
    </script>
</head>

Rumor has is that Brad Neuberg calls cookies "Dojo Offline Lite."