cookie_wrapper 0.1.2 copy "cookie_wrapper: ^0.1.2" to clipboard
cookie_wrapper: ^0.1.2 copied to clipboard

Platformweb

An HTTP Cookies implementation for the client to get, set and remove cookies. It is very simple and well tested. Uses a package test to maintain capability on all platforms.

example/example.dart

import 'package:cookie_wrapper/cookie.dart';

void main() async {
  var cookie = Cookie.create();

  // Create a session cookie:
  cookie.set('key', 'value');

  // Create a cookie that expires in a week:
  cookie.set('key', 'value', maxAge: Duration(days: 7));

  // Create a cookie that is valid for a certain path and domain:
  cookie.set('key', 'value', path: '/test', domain: 'test.com');

  // Read a cookie:
  var value = cookie.get('key');
  print(value);

  // Delete a cookie:
  cookie.remove('key');
}
2
likes
140
points
342
downloads

Publisher

verified publisherdavidtaylor.io

Weekly Downloads

An HTTP Cookies implementation for the client to get, set and remove cookies. It is very simple and well tested. Uses a package test to maintain capability on all platforms.

Repository (GitLab)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on cookie_wrapper