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

28

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

29

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

34

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

Re: Users reporting logging in problem

I am having this same problem w/ 1.3.4.

My server & Forum are set to the same timezone, and I've even tried the hacks mentioned to increase the expire time on the cookie.

I thought that had solved the problem, but only for certain accounts which is the really weird thing. I can login no problem now with my admin account, but several users cannot, they are getting the:

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.

I have the verified trying to login for the user from my computer, and I get the same thing. So that throws out all the posts about this bug having to do with the users time clock, as why would I be able to login to my account, and not to his on the same computer?

Anatoly - My findings here go against the 3 possible scenario's you have mentioned. as everything is set correctly everywhere.

Re: Users reporting logging in problem

Update

Problem solved. The user's group_id, had been set to an invalid id..

I think that pun_bb should be smarter in detecting that, otherwise the login error w/ cookies isn't the most intuitive way to find the solution.

Re: Users reporting logging in problem

The user's group_id is 3. What was wrong with that?
Thanks!

Re: Users reporting logging in problem

That's not a problem - The problem was in my community, I have custom values set, and by accident a users group_id was set to a value of a group that didn't exist...

Re: Users reporting logging in problem

Sounds like time zone problem. My user changed to another computer, and he still cannot login. He is in China. Well, some other Chinese are able to login.  I am in Canada.  This is the web site : http://86000000132767.31615.com

Re: Users reporting logging in problem

At first it was a timezone/cookie issue for me. Then once I solved that by adding the hack to the login file (to set it to always auto-login) that went away. And for some reason just this one user's account wasn't logging in.

I checked everything over:
- server timezone
- punbb timezone
- computer timezone
etc

Nothing. Fixing the User_id to a valid one made the problem go away.

In your case @frankpeng try the method outlined here:

http://punbb.informer.com/forums/post/124057/#p124057

Re: Users reporting logging in problem

Hi there, since a week I was having the same problem.
The fix shown here http://punbb.informer.com/forums/post/124057/#p124057 works.
Is this fix safe ? No problem using it ?
Can I just do that without taking care of anything else ?
Thanks

Re: Users reporting logging in problem

TY verry much ! big_smile work fine now for me big_smile


Anatoly wrote:

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.