#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:
Has a Patch: yes 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 23 months ago.
Example showing the problem
0001-Fix-13543-Make-sure-Sunday-is-returned-properly.patch (1.0 KB) - added by markh 23 months ago.

Download all attachments as: .zip

Change History (7)

Changed 23 months ago by markh

Attachment: BHttpTime.cpp added

Example showing the problem

comment:1 Changed 23 months ago by markh

Has a Patch: set

comment:2 Changed 23 months ago by waddlesplash

Patch looks OK to me.

comment:3 Changed 23 months ago by korli

Why not a ternary conditional operator instead of the modulo?

comment:4 Changed 23 months ago by markh

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 Changed 23 months ago by pulkomandy

Resolution: fixed
Status: newclosed

Applied in hrev51194. Unit tests would be welcome.

Note: See TracTickets for help on using tickets.