Change HTTPCookie to support expiry times in the past.

This commit is contained in:
Karl Reid
2013-06-17 21:55:59 +01:00
parent b1161bdb1e
commit c8b7b7ee9e
3 changed files with 69 additions and 3 deletions

View File

@@ -256,7 +256,7 @@ std::string HTTPCookie::toString() const
result.append("; path=");
result.append(_path);
}
if (_maxAge >= 0)
if (_maxAge != -1)
{
Timestamp ts;
ts += _maxAge*Timestamp::resolution();
@@ -296,7 +296,7 @@ std::string HTTPCookie::toString() const
result.append(_path);
result.append("\"");
}
if (_maxAge >= 0)
if (_maxAge != -1)
{
result.append("; Max-Age=\"");
NumberFormatter::append(result, _maxAge);