|
Jan '16 |
4 |
1270 |
0 |
Hello.
It depends on the session adapter you use (see: https://phalcon-php-framework-documentation.readthedocs.org/en/latest/api/Phalcon_Session_Adapter.html) You can implement your own session adapter and control the life cycle inside it.
Note, session.gc-maxlifetime won't work! (see: https://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime) There is a good explanation here https://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes
Please, describe here which session lifecycle you need and I will try to help
The configuration of session in my project: public/index.php
...
$di->setShared('session', function() {
$session = new Phalcon\Session\Adapter\Files();
$session->start();
return $session;
});
...
Could you please tell me what is the default life cycle of session when using the above configuration?
Do I have to implement a new session adapter? If it is necessary, could you please give me an example including the life cycle configuration?
Thanks!
Hello.
It depends on the session adapter you use (see: https://phalcon-php-framework-documentation.readthedocs.org/en/latest/api/Phalcon_Session_Adapter.html) You can implement your own session adapter and control the life cycle inside it.
Note, session.gc-maxlifetime won't work! (see: https://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime) There is a good explanation here https://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes
Please, describe here which session lifecycle you need and I will try to help
As Denis said, session.gc-maxlifetime won't work.
By default a session lasts 1440 seconds (24 minutes). You can modify that setting by either changing your php.ini file, or calling
ini_set()
with the appropriate parameters.
I use session to store user login data. But it seems to be invalid after 3 or 4 hours. User had to re-login the system again. I want to set this time to be 12 hours.
Please explain in more detail what you are referring to by "life cycle"