Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

cookie jar implementation doesn't take account of path property of cookie #2

Open
belgianwaves opened this issue Jul 29, 2019 · 4 comments

Comments

@belgianwaves
Copy link

No description provided.

@droplet-js
Copy link
Owner

could you reply chinese?

@belgianwaves
Copy link
Author

I'm sorry i don't speak chinese.
It seems your cookie jar implementation doesn't take into account the 'path' property of a cookie.
Our site uses global cookies (path=/) and these don't seem to work.

Sincerely,
Johan

@droplet-js
Copy link
Owner

you can import fake_cookie_manager: 0.1.0,and add the follow code:

import 'package:fake_cookie_manager/fake_cookie_manager.dart';
import 'package:fake_okhttp/fake_okhttp.dart';

class WebkitCookieJar extends CookieJar {
  @override
  Future<void> saveFromResponse(HttpUrl url, List<Cookie> cookies) {
    return CookieManager.saveCookies(url: url.toString(), cookies: cookies);
  }

  @override
  Future<List<Cookie>> loadForRequest(HttpUrl url) {
    return CookieManager.loadCookies(url: url.toString());
  }
}

@belgianwaves
Copy link
Author

Thank you for the quick reply!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants