A
A
alysenko2017-11-13 12:26:57
Sessions
alysenko, 2017-11-13 12:26:57

How to set the duration of the session on the site on Phalcon?

There is a site on Phalcon.
In php.ini
session.gc_maxlifetime = 1400
Since there is no access to the php.ini file, I try to override this value via php and set the duration to 8 hours:

ini_set('session.gc_maxlifetime', 28800);
ini_set('session.cookie_lifetime', 28800);
session_set_cookie_params(28800);

But for some reason this code doesn't work. What is most interesting, if I set the session duration to 5 minutes, then everything works fine:
ini_set('session.gc_maxlifetime', 300);
ini_set('session.cookie_lifetime', 300);
session_set_cookie_params(300);

What could be the problem, why if you set the duration more than in php.ini, it does not work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VisualIdeas, 2017-11-18
@VisualIdeas

Colleague, 300 is less than 1400 set in php.ini)))))
That's why you can install it.
And override the php.ini settings
php.net/manual/ru/session.configuration.php
Look towards the session.save_path settings for the sessions of these files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question