Browse files

fix dst cookie bug reported in issue #73

  • Loading branch information...
1 parent b7f3693 commit af9fa1ba5ff8a2055728ba9ffd9da3659f5863c5 @emad emad committed Mar 9, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/mochiweb_cookies.erl
View
7 src/mochiweb_cookies.erl
@@ -122,6 +122,13 @@ quote(V0) ->
rfc2109_cookie_expires_date(LocalTime) ->
{{YYYY,MM,DD},{Hour,Min,Sec}} =
case calendar:local_time_to_universal_time_dst(LocalTime) of
+ [] ->
+ {Date, {Hour1, Min1, Sec1}} = LocalTime,
+ LocalTime2 = {Date, {Hour1 + 1, Min1, Sec1}},
+ case calendar:local_time_to_universal_time_dst(LocalTime2) of
+ [Gmt] -> Gmt;
+ [_,Gmt] -> Gmt
+ end;
[Gmt] -> Gmt;
[_,Gmt] -> Gmt
end,

0 comments on commit af9fa1b

Please sign in to comment.