QNetworkCookie - use RFC6265 rules for max-age
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Thu, 7 Jun 2012 14:41:39 +0000 (15:41 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 26 Jun 2012 22:46:35 +0000 (00:46 +0200)
commit7b61e60676cd7989050d50f6e823e30a5c99cf14
tree4b2c88e5feb4aae4bb80f98358f9a3a369cd11e4
parent57adc1761d254b70cf5a2a2572b83144daade637
QNetworkCookie - use RFC6265 rules for max-age

If unparsable, ignore the max-age attribute but process the rest of
the cookie normally.
If max age <= 0, set expiration time to "earliest representable time"
To keep this a safe value for conversions, time_t of 0 is used.

This fixes cases 0019 and comma0005 in the test suite.
Due to this change, cookies may be sent after they should have expired
in case the max-age was malformed. Previously they would have been
discarded immediately, which is more likely to break web services.

Task-number: QTBUG-15794
Change-Id: I7882af8eb37db156785e4e358ca639e90c94f8d0
Reviewed-by: Richard J. Moore <rich@kde.org>
src/network/access/qnetworkcookie.cpp