Fixed an issue with how cookies were being saved