O
O
ozz2011-11-04 15:03:32
PHP
ozz, 2011-11-04 15:03:32

Cancellation of winter time - problems with user authorization through cookies. How to solve by means of the server?

Good day!
In addition to the already described effects associated with moving to GMT + 3 (Belarus), we encountered another one.
Given: Web service administration system with login-password authorization using Cookie. the inactive administrator session time is set to 10 minutes.
Symptom of the problem: The administrator (in the general case, the authorized User) logs in, enters the correct login and password, the system accepts it (a message about successful authorization is displayed), and the user again goes to the page asking for the login and password. Let's leave aside the obvious mistake of the developers, who were too lazy to display a system message about why this is happening.
Cause:It turned out that the user (from Belarus) set the correct local time on his local machine, but did not change his time zone, remaining in GMT + 2.
Mechanism of action of the reason: With the correct login and password, the system sets a Cookie with a lifetime of +10 minutes. The real time of the client coming to the server in this case is -1 hour to the real time of the server, respectively, the set cookie with a duration of 10 minutes is already expired in advance and, accordingly, the user must re-authorize.
Solution: Set the time zone on the user's computer correctly, for Belarus to GMT+3, and correctly set the local time on the user's computer.
Attention question:how to solve this problem by means of the server and not depend on such nuances on the client side at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2011-11-04
@BuriK666

Cookies are set not just +10 minutes, but a specific time is indicated (according to UTC / GMT)
If we are talking about 10 minutes, then the client and / or server clock may not be accurate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question