react-native-cookies / cookies

🍪 Cookie Manager for React Native
MIT License
480 stars 95 forks source link

CookieManager.set on iOS prepends an "." to the domain #155

Closed nigimaxx closed 2 years ago

nigimaxx commented 2 years ago

If a cookie with a domain is passed to CookieManager.set e.g. example.com it becomes .example.com in the iOS device's cookie storage.

It looks like the problem is related to those lines.

A dot is prepended to the domain but never removed.

https://github.com/react-native-cookies/cookies/blob/69fe6557b0f2c286e6df6fa9100391ad2d163860/ios/RNCookieManagerIOS/RNCookieManagerIOS.m#L288-L302

nigimaxx commented 2 years ago

Was using @react-native-community/cookies in my package json. Maybe a warning in the readme would help to avoid this in the future.