Opened 8 years ago

Closed 8 years ago

#13543 closed bug (fixed)

Cookies with expiration date on Sunday are stored incorrectly

Reported by: markh Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Network Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

When a cookie has an expiration date of Sunday, the cookie is stored to disk incorrectly. Instead of storing "Sun" as the day, it stores "?". I tracked this to commit hrev50924 which sets the day of the week when converting the BHttpTime as a string. The DayOfWeek function returns 7 for Sunday while the strftime expects 0 for Sunday. I have an example that shows the problem and a patch that fixes the problem in BHttpTime.

Attachments (2)

BHttpTime.cpp (1.6 KB ) - added by markh 8 years ago.
Example showing the problem
0001-Fix-13543-Make-sure-Sunday-is-returned-properly.patch (1.0 KB ) - added by markh 8 years ago.

Download all attachments as: .zip

Change History (7)

by markh, 8 years ago

Attachment: BHttpTime.cpp added

Example showing the problem

comment:1 by markh, 8 years ago

patch: 01

comment:2 by waddlesplash, 8 years ago

Patch looks OK to me.

comment:3 by korli, 8 years ago

Why not a ternary conditional operator instead of the modulo?

comment:4 by markh, 8 years ago

The modulo is a simple fix and easy to understand, but feel free to change it to a conditional operator if that fits the style of the project better.

comment:5 by pulkomandy, 8 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51194. Unit tests would be welcome.

Note: See TracTickets for help on using tickets.