Problems with Session CakePHP

0

Dear good afternoon, I would like to comment on a problem I have based on a system developed in cakephp version 2.4:

It turns out that for some reason or reason CakePHP deletes the sessions without any reason, check the driver, js, html and everything is correct.

It is not the first time that I develop systems in cake, they are already several, I have been in the field for years but this is the first time that happens to me and I already exhaust all the instances, at the time of the login it is ok, authenticates and generates the login correctly with the Session Aauth component, but, every time I browse the system, I log out and it takes me out of the system.

The problem is that the log shows nothing, no error and not only destroys the login session, but destroys all sessions (car or others).

Make changes in the core, php, change the Security level to "low", change the session timeout, enable the checkAgent and autoRegenerate and even then I still have problems, the truth is that I do not know what else to do.

I would greatly appreciate a comment or someone who can help me a little with this.

    
asked by Claudio Rivas 14.02.2017 в 20:15
source

2 answers

0

Something similar had happened to me some time ago and, after many laps, I realized that it was a problem about the domain. When developing several applications on the same domain, the session cookie in the browser fails (although they have a different name).

Is that your problem? Solving it can be simple by creating a subdomain for each new project.

On the other hand, you could also review the management of the session from the core file in the config directory and move from the use of cake to php:

Configure::write('Session', array(
    'defaults' => 'php',
    'cookie' => 'nombre_de_la_cookie',
    'timeout' => 'tiempo_de_vida',
    'cookieTimeout'=> 'tiempo_de_vida'
));
    
answered by 03.05.2017 в 16:39
0

Mira had the same problem in the same version, and solve it with this by changing in core.php I use the cake session, and remember to put the write and read permissions to the tmp folder. With this, solve all my problems. Greetings

    Configure::write('Session', array(
    'defaults'=>'cake', 
    'cookie'=>'algunnombre',
    'timeout' => 9000, // The session will timeout after 30 minutes of inactivity
    'cookieTimeout' => 4567, // The session cookie will live for at most 24 hours, this does not effect session timeouts
    'checkAgent' => false,
    //'autoRegenerate' => true, // causes the session expiration time to reset on each page load
));
    
answered by 16.11.2017 в 14:36