updated the addCookie function to support secure and HTTPOnly