Fixed previous commit may delete unwanted cookies. Sync tests from upper branches.