Fix max-age setting
* It would not work for cookies set to expire tomorrow or later, since setting the time in a BDateTime does not overflow to the date. * The BDateTime API could be improved to make this look nicer.
This commit is contained in:
@@ -245,7 +245,7 @@ BNetworkCookie&
|
||||
BNetworkCookie::SetMaxAge(int32 maxAge)
|
||||
{
|
||||
BDateTime expiration = BDateTime::CurrentDateTime(B_GMT_TIME);
|
||||
expiration.Time().AddSeconds(maxAge);
|
||||
expiration.SetTime_t(expiration.Time_t() + maxAge);
|
||||
return SetExpirationDate(expiration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user