cookieWithNewValue method

Cookie cookieWithNewValue(
  1. Cookie cookie,
  2. String newValue
)

Returns a new Cookie that is the same as the input cookie, but with a newValue.

Implementation

Cookie cookieWithNewValue(Cookie cookie, String newValue) {
  return Cookie(cookie.name, newValue)
    ..domain = cookie.domain
    ..expires = cookie.expires
    ..httpOnly = cookie.httpOnly
    ..maxAge = cookie.maxAge
    ..path = cookie.path
    ..secure = cookie.secure;
}