Return empty string and not null when cookie doesn't exits. This can be changed back to null by changing one comment. This is much more useful if you want to insert cookie value into input text element with document.write();