cooky 2.0.0 copy "cooky: ^2.0.0" to clipboard
cooky: ^2.0.0 copied to clipboard

Platformweb

An HTTP Cookies implementation for the client to get, set and remove cookies. It is very simple and well tested.

example/example.dart

import 'package:cooky/cooky.dart' as cookie;

void main() async {
  // 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');
}
10
likes
140
pub points
81%
popularity

Publisher

unverified uploader

An HTTP Cookies implementation for the client to get, set and remove cookies. It is very simple and well tested.

Repository (GitLab)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on cooky