There was a task to intercept / track the restart on your own domain with the cookies disabled. Presumably, the only way is to get the expected headers from the server after the reboot and thereby fix the fact of the reload.

Form the title:

header('Cache-Control: max-age=1234567'); header('Location: http://mydomain.com'); exit; 

I'm trying to get an array with the present Cache-Control key and the expected value of 1234567 .

When using the getallheaders() function, or in general there is no array element with this key, or (after an additional reboot) another element value: [Cache-Control] => max-age=0

When using apache_request_headers() I get only one array element: [X-Powered-By] => PHP/5.3.5 (on localhost) and generally an empty array when reloading on a real server.

I ask for advice and help: how to set, get and process arbitrary server headers ?

The main question is: is there any other way to identify a re-entry to the site after a reboot, except for processing arbitrarily defined headers with cookies disabled?

  • Do not quite understand. Do you need to track the event or just get a second call? - Kostiantyn Okhotnyk
  • I need to fix exactly the second call immediately after the reboot . The way of implementation is not important. If this is a repeated entry with disabled cookies, the client will not be redirected to authorization. - 118_64
  • maybe you should try sessionStorage on js? And send Ajax if something is there? - Kostiantyn Okhotnyk
  • Or do you need a php solution only? - Kostiantyn Okhotnyk
  • The idea is good, but you need a way to fix the restart with both scripts and cookies disabled. Otherwise, the client leaves for an endless loop of redirections. Those. php only - 118_64

1 answer 1

The task falls into 2 subtasks 1) to find out the client without cookies 2) to find out that he reloaded the page.

The first task can be solved by saving ip and user_agent clients and the time of the request. The second one is just to look at each request - and didn’t such a client come in just recently?