findExpiresAttr method

DateTime? findExpiresAttr(
  1. String setCookie,
  2. int startIndex
)

Implementation

DateTime? findExpiresAttr(String setCookie, int startIndex) {
  final ai = setCookie.indexOf("Expires=", startIndex);
  if (ai == -1) {
    return null;
  }
  final i = ai + 8;
  final j = setCookie.indexOf(';', i);
  final expiresStr = j == -1 ? setCookie.substring(i) : setCookie.substring(i, j);

  return _cookieDateFormat.parse(expiresStr, true);
}