Closed Tsjippy closed 1 year ago
99% sure the time on the server is off (or it's off on the previous one).
Can I adjust the time in the database ? Or should I change the time on the server?
I don't know what time in your database would be related to this? If you check the actual time on the server(s) you'll most likely see one of them is off.
yes they are in different time zones: Server 1: Thu Dec 1 16:25:05 WAT 2022 Server 2: Thu Dec 1 08:25:04 MST 2022
By default, this library uses time()
, which, according to the PHP doc, returns a Unix Timestamp. which is UTC time (and TOTP uses UTC). So either you used a different timeprovider or your timezones aren't configured correctly.
I have changed the timezones, now they are in the same timezone, still doesn't work
Try ensureCorrectTime()
(on both servers), see the docs.
If both are OK, please give the output of echo time()
on both servers (from (roughly) the same time, no more than a few seconds apart) and share your $discrepancy
value, if overridden.
in bash you can do date +"%s"
and then compare the output to https://time.is/Unix_time to confirm the values are the same or within a few seconds
Thanks both for your replies! It works again
Thanks both for your replies!
It works again
Please share with us what the issue was?
I think it was a time issue. I changed the time zone and now it works ok
I have migrated my website to a new server.
Now the 2fa verification always fails (verifyCode returns 0);
How can I find out why and how to solve it? I don't want all my users to set it up again....
What changed: Moved from php 7.4 to php 8.0.25 Moved from utf8 to utf8mb4 Moved to a different timezone