Skip to content

bojanivanovski/webview_cookie_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webview Cookie Manager

pub package

A flutter library to manager your web cookies for Android(API level 9) and iOS(11+).

Get started iOS

Set minimum version for iOS to 11.0

How to use

The WebCookieManager can be used directly or together with webview_flutter.

Get cookies:

final cookieManager = WebviewCookieManager();

final gotCookies = await cookieManager.getCookies('https://youtube.com');
for (var item in gotCookies) {
  print(item);
}

Set cookie

await cookieManager.setCookies([
             Cookie('cookieName', 'cookieValue')
               ..domain = 'youtube.com'
               ..expires = DateTime.now().add(Duration(days: 10))
               ..httpOnly = false
           ]);

Check is any cookie available

await cookieManager.hasCookies();

Remove cookie

await cookieManager.removeCookie();

Clear cookies

await cookieManager.clearCookies();

For more examples check example folder.

Troubleshooting

Set minimum target iOS version to 11(why) If you are using Objective C, check that PodFile have a flag use_frameworks (why you need to do it)

target 'Runner' do
 use_frameworks!
 use_modular_headers!
 ..........
end

How it works

The cookies stores and retrieves using the httpCookieStore for iOS and CookieManager for Android.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 29.0%
  • Dart 28.7%
  • Java 26.2%
  • Ruby 9.1%
  • Kotlin 3.9%
  • Objective-C 3.1%