Fix cookies with far expiration date.
Some websites set cookies expiring in the (not so) far future, after year 2038. So, using time_t to store the cookie expiration date won't do. Use the BDateTime class instead. This makes goodsearch.com login work again (#10460).
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <ctime>
|
||||
|
||||
#include <DateTime.h>
|
||||
#include <String.h>
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -24,21 +25,21 @@ enum {
|
||||
class BHttpTime {
|
||||
public:
|
||||
BHttpTime();
|
||||
BHttpTime(time_t date);
|
||||
BHttpTime(BDateTime date);
|
||||
BHttpTime(const BString& dateString);
|
||||
|
||||
// Date modification
|
||||
void SetString(const BString& string);
|
||||
void SetDate(time_t date);
|
||||
void SetDate(BDateTime date);
|
||||
|
||||
|
||||
// Date conversion
|
||||
time_t Parse();
|
||||
BDateTime Parse();
|
||||
BString ToString(int8 format = B_HTTP_TIME_FORMAT_PARSED);
|
||||
|
||||
private:
|
||||
BString fDateString;
|
||||
time_t fDate;
|
||||
BDateTime fDate;
|
||||
int8 fDateFormat;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user