Hello! Authorization on the site is written using cookies.

SetCookie ('Login', mysql_real_escape_string($_POST['login']),time() + 1800); 

For several months everything worked fine, and suddenly the problems started, some users started to set the lifetime of the cookies incorrectly. Those. it turned out that cookies were immediately deleted after installation. If you delete the lifetime setting, everything starts working. Do not tell me what could be the problem?

  • "In general, they were immediately removed after installation." - and can it be that they are completely disabled by users? are you doing a check for this? - Pavel Dura
  • no, it cannot, because everything worked before, and if the cook time is not set, then everything works too - masha2
  • after all, the time of the cookie should not depend on the time settings on client machines? - masha2

1 answer 1

From the settings - no, but from the value - yes.

Check the server time first.

In general, they usually do the opposite. The cookie itself is done "before the browser is closed", and already on the server, in the session they write the execution time of the last call, and if a lot of time has passed from the last call, they close the session.

  • Thank! The time on the server is correct. - masha2