Javascript cookieMonster object (v )

What does it do?top ↑ 

It's a Javascript object that adds, edits, deletes and retrievs client side cookies.
download form sourceforge.net

How to use?top ↑ 

Type something into the form below and click the 'save cookie value' button, this will update a cookie value and refresh the page. To remove the cookie value click 'remove cookie and reload'.

What else do I need to know?top ↑ 

Methods

  • cookieEnabled : checks cookies are enabled and returns a boolean
  • getCookie : returns the cookie value
  • killCookie : removed a cookie
  • setCookie : sets a cookie value
  • syncForm : loads cookie info into a form
<script type="text/javascript">
if (cookieMonster.cookieEnabled()){
    // example set value 
    cookieMonster.setCookie('userName','Testie MacTester');
    // example get value 
    var name = cookieMonster.getCookie('userName');
    // example remove 
    cookieMonster.killCookie('userName');
} else {
    // cookies not avalible, do fallback?? 
}
</script>

TODOtop ↑ 

  • Extend SyncForm method to support more form element types
  • Sort out better support for multiple cookies with the same name (pathcookies)

Bugs and issuestop ↑ 

  • tbc