How to remember that I am different from the session timeout

I created an application in CakePHP that allows the user to log in and do something like that, it forces the user to register for about 24 hours, I think, by default. And this is handled by the session / cookie, since a cookie is also created ...

1.) So that would remember how I brought to the party? Since all that would be done is to create ANOTHER cookie that sets a timeout and delays the user from logging in ... But does this functionality exist in every application by default with session right? But I saw how many sites do this, but I don’t understand why, because the session does this out of the box: /

2.) Also, how do sessions end even if the user continues to use the website? for example, if I installed it for 1 minute, but updated every 30 seconds, it will expire anyway ... but I kept the site active before it expires, and how can it still expire? This is annoying because I have an application for 1 hour, but even when the client uses the site, it expires after 1 hour regardless of activity.

It would be great if someone could answer these 2 questions.

UPDATE: I created a generosity on this to get the CakePHP expert to help fix this issue. The problem is that the sessions expire after a REGARDLESS user interaction timeout. What I want to do is say that my session lasts 5 minutes and the user calls the postback every 30 seconds, after which the session will continue after 5 minutes. This is not the case at the moment ...

Configure::write('Session', array(
        'start' => true,
        'defaults' => 'php',
        'timeout' => 1,
        'cookieTimeout' => 1,
        'autoRegenerate' => true
    ));
+5
source share
5 answers
  • What would bring this is that if the user closes his browser and restarts it, he will still be logged in automatically. This does not apply to session cookies, since such a cookie is deleted as soon as the browser closes.

  • , , 30 , . , reset now + 1 minute. , , , .

+8

, . ​​ , , .

. , . , PHP- Cake. Cake. , .

, , Cake .

+1

1.) cookie " " , cookie "0". , ", ". , " " , , , cookie . . , , : Yahoo! , cookie , .

2.) cookie , . ? .

0
source

If I do this:

    Configure::write('Session', array(
        'start' => true,
        'defaults' => 'cake',
        'timeout' => 1,
        'cookieTimeout' => 1,
        'autoRegenerate' => true
    ));

/**
 * The level of CakePHP security.
 */
    Configure::write('Security.level', 'high');

He fixes the problem! Thus, the session lasts 10 seconds, but if I update every 2-3 seconds, I will still be logged in 10 seconds after updating the cookie. So it seems that the PHP settings of my hosting environment / cause an expiring session / cookie ... Why would this happen?

0
source

All Articles