Fixing bug in cookie defaults, adding unit tests to verify