Updating the cookie read function