We are saving cookies with this code,
await cookieJar.saveFromResponse(getCookieUri(), cookies);
the cookie Jar is a PersistCookieJar from the cookie_jar-3.0.1 library.
When I debug I will step over the saveFromResponse line above and on the very next line check if the cookie has been saved but it doesn’t show up when I call
await cookieJar.loadForRequest(getCookieUri());
Nor does it show up at any other point in the code.
This is how I am creating the cookie,
final cookieJar = serviceLocator<PersistCookieJar>();
final cookies = await cookieJar.loadForRequest(getCookieUri());//'http://www.sofi.com/atrributionCookie'
if (cookies.contains(_cookieName)) {
// cookie already exists and is not expired
return;
}
// final uuid = UuidUtil.mathRNG().toString();///the '['character breaks the cookie.
final uuid = Uuid().v4();
// final cookie = Cookie.fromSetCookieValue(_cookieName);
final cookie = Cookie(_cookieName, uuid);
cookie.domain =
serviceLocator<AppConfig>().get<String>(AppConfigKeys.baseURL);
cookie.value = uuid;
cookie.expires = DateTime.now().add(const Duration(days: 1));
cookies.add(cookie);
Does any one have any idea why it is not being saved?