added check for cookie length and support for line breaks
tweaks for dates