improve document.cookie implementation

- the separator '; ' instead of ';'
- more readable code
- additional test case