Re: Testing
- Posted by jimcbrown (admin) Oct 04, 2008
- 1223 views
Upon rereading my post, I want to make clear that I believe jacquesd when he says he has found the bug.
He found the bug, but I don't seem able to reproduce it properly, which makes debugging and fixing the bug more difficult.
Finally I localized the login bug. It is not in the euForum code but in datetime.e library. When in login form if the <remember me forever> checkbox is not checked, euforum code try to set a cookie that expires in 1 hour. the actual code is:
expire = dt:now_gmt() if web:post_has("login_forever") then expire = dt:add(expire,1,YEARS) else expire = dt:add(expire,1,HOURS) -- this return date prior du current date!! end if
the dt:add() function return a date prior to actual date so the browser doesn't set the cookie as it is already expired. This is a bug to be solved by the datetime.e library maintainer.
For my part I will replaced all 1 hours cookies by session cookies. Those expires when the browser is closed. Login that is not set forever will last the browser session.
Jacques
With this simple test program, I couldn't reproduce the bug. I am at -0400, and at the time of writing here are my times:
$ date Sat Oct 4 20:11:51 EDT 2008 $ date utc Sun Oct 5 00:11:53 UTC 2008 $
include std/datetime.e object expire = now_gmt() ? expire expire = add(expire, 1, HOURS) ? expire
$ exu dt.e {2008,10,5,0,9,26} {2008,10,5,1,9,26}
It is not clear to me why expire would be considered as being before the current date.