A
A
AlexeyZernov2015-12-06 14:11:14
PHP
AlexeyZernov, 2015-12-06 14:11:14

How do vk.com or facebook.com determine local time when requested without parameters, cookies and JS?

Good day to all!
I do application which stores in basis of date of records in server time. It is necessary to display the time of entries depending on the user's local time. The simplest options are:
1) Make a setting in the application so that you can set the zone and then, before issuing, the server will issue dates depending on the zone. (I would not like to store all zones, and the user to select them)
2) The server issues the basic markup, and then the JS application is loaded, which receives JSON with server dates, converts them and inserts them. (I would like to display the last 5 records at once, and not load and parse them with JS.)
How does the same vk.com do it? It immediately gives the correct time from the server, without JS, in the same AJAX, the markup with the time is already returned. No zones need to be entered, everything is based on local time, I changed the system settings and that's it. I looked, no parameters are passed in the request, there are no cookies and localstorage associated with this, even logged out of the account, it still determines. Identification by IP is excluded. In general, so far the magic is how they determine my time in the system, if everything is cleared in my browser, I don’t pass them any parameters, nor set it in the settings.
Who will explain how they do it and how to do the same, thank you very much !!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexeyZernov, 2015-12-06
@AlexeyZernov

As for the above, I repeat once again that this is not JS, otherwise it would not have issued the changed time immediately in the first request. Yes, VKontakte does not work without JS and gives out that it is a bad browser, but because it is all on AJAX and all sorts of things with the DOM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question