deleteCookie method

void deleteCookie(
  1. String name, {
  2. String path = '/',
})

deleteCookie deletes a cookie with given name. Use path to specify the path from which the cookie has to be removed.

Implementation

void deleteCookie(String name, {String path = '/'}) {
  cookies.add(Cookie(name, '')
    ..expires = DateTime.now().subtract(_aDay)
    ..maxAge = -1
    ..path = path);
}