Re: Users reporting logging in problem

Cereal wrote:

so i think this is a timezone problem ...

the problem is that phps time() function is using systems local time and not GMT time ...
a solution could be to use gmdate('U') to generate the base timestamp for the cookie time.

time():

PHP manual wrote:

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Cereal wrote:

the timestamp thats set as the expire time is 1231694940 (Sun, 11 Jan 2009 17:29:00 GMT)
the timestamp thats used at the browsers end is 1231723740 (Mon, 12 Jan 2009 01:29:00 GMT)

Try to check the timezone at your server. Incorrect setting may result this way.

Carpe diem

Re: Users reporting logging in problem

Thanks Dverte
I just implemented that change. Let's hope it works.
I logged out and then went to login.php but the "remember me" wasn't checked. Should your  hack result in that box being checked or not?

Thanks
Mark

Re: Users reporting logging in problem

Hi,

esupergood wrote:

I logged out and then went to login.php but the "remember me" wasn't checked. Should your  hack result in that box being checked or not?

No, the checkbox will not be checked automatically. The hack basically ignores whether the box is checked or not, and just carries on as if the checkbox was in fact checked.

Hope it works for you too. smile

Re: Users reporting logging in problem

Anatoly wrote:

Try to check the timezone at your server. Incorrect setting may result this way.

I am pretty sure changing the server timezone to match the forum's default timezone would make the problem go away. Changing the server timezone, however, is not a practical solution for some.

The thing is, many people have servers in other countries because it is less expensive. For example, my forum caters to UK users, so the forum timezone is set to GMT, but the server is a cheap box in California, so the server timezone is set to 8 hours earlier (and should be, as it also runs other services on the box catering to US users).

For an official fix to this issue, I think that when calculating the cookie expiry times, the difference between the forum default timezone and the actual timezone of the server needs to be taken into account.

I'll use my "Remember me" hack in the meantime as my head hurts!

Re: Users reporting logging in problem

dverte wrote:

I am pretty sure changing the server timezone to match the forum's default timezone would make the problem go away. Changing the server timezone, however, is not a practical solution for some.

I mean that timezone should be correct.
If it is 12:00 in GMT and your server's TZ is set to +2, you MUST have 14:00.
This means that gmdate() will result the same worldwide.
You may check it with gmdate('r') call - it should give you the current time in GMT zone. If it doesn't, server settings are incorrect (not in terms of PunBB, but generally incorrect).

Carpe diem

Re: Users reporting logging in problem

I have this kind of trouble about time/time zone at user login. One of my users could not login into forum, he get the message:

You appear to have logged in successfully, however a cookie has not been set. Please check your settings and if applicable, enable cookies for this website.

The problem was that user's computer RTC was earlyer with about 3-4 minutes as I figured out from testing and the user confirmed. Very strange.... hmm hmm hmm

Re: Users reporting logging in problem

For an official fix to this issue, I think that when calculating the cookie expiry times, the difference between the forum default timezone and the actual timezone of the server needs to be taken into account.

I agree. Or find out what changed between 1.2 and 1.3 because it never happened with 1.2.
cheers
SG

Re: Users reporting logging in problem

The forum doesn't use client-side generated timestamps. All the timestamps are generated by the server and are in GMD by definition.

There are three chances for troubles, I see:
1. Incorrect TZ at the server (i.e. gmdate() gives incorrect result).
2. Incorrect TZ at the client-side: user just has incorrect time locally set.
3. Incorrect browser behavior: cookie is removed too early. Maybe browser has modified the expiration date for the cookie (it is sent in GMT from the server and must be untouched).

Please, check these cases and report if your trouble doesn't match them.

Carpe diem

Re: Users reporting logging in problem

Im not sure and I cannot explain how it can help, but I also have same problem, I resolved this by double clicking on my clock... click INTERNET TIME and sychronized it... and bingo.... I can now log in with my forum