cookie_jar icon indicating copy to clipboard operation
cookie_jar copied to clipboard

Non-session Cookies won't saved without `persistSession` flag

Open mertcorumlu opened this issue 1 year ago • 0 comments

I think the condition on this line is not true: https://github.com/flutterchina/cookie_jar/blame/a14f284ba731fc2e69bd940770b182adb2659781/lib/src/jar/persist.dart#L133

final isSession = cookie.cookie.expires == null && cookie.cookie.maxAge == null;
if ((isSession && persistSession) || (persistSession && !cookie.isExpired())) {
    return MapEntry(key, cookie);
} else {
    return MapEntry(null, cookie);
}

Why should persistSession be true to save cookies that are not session cookies and not expired ? This condition implies, one should should store all cookies including session cookies, or none at all.

mertcorumlu avatar Nov 18 '23 20:11 mertcorumlu