Fix cookie generation for all platforms