cookie is adding but still not working