javascript cookie simple solution

3 functions are borrowed from Here

Read more