Сессия пользователя - нестандартное решение, но требуется ваша помощь в осуществлении.

Главные вкладки

Аватар пользователя Ritka Ritka 11 апреля 2017 в 19:43

Так вот изначально в php settings.php Такие секунды в сессиях - ini_set('session.gc_maxlifetime', 200000); и ini_set('session.cookie_lifetime', 2000000); и я хочу чтбы пользователя не выбрасывало с сайта 100 дней. Нормально будет если поставить в ini_set('session.gc_maxlifetime', 200000);

а в поставить ini_set('session.cookie_lifetime', 8640000); тоесть 100 дней, не будет в таком случае ничего конфликторовать ?

Лучший ответ

Аватар пользователя dgastudio dgastudio 12 апреля 2017 в 11:14

ession.gc_maxlifetime

This value (default 1440 seconds) defines how long an unused PHP session will be kept alive. For example: A user logs in, browses through your application or web site, for hours, for days. No problem. As long as the time between his clicks never exceed 1440 seconds. It's a timeout value.

PHP's session garbage collector runs with a probability defined by session.gc_probability divided by session.gc_divisor. By default this is 1/100, which means that above timeout value is checked with a probability of 1 in 100.
session.cookie_lifetime

This value (default 0, which means until the browser's next restart) defines how long (in seconds) a session cookie will live. Sounds similar to session.gc_maxlifetime, but it's a completely different approach. This value indirectly defines the "absolute" maximum lifetime of a session, whether the user is active or not. If this value is set to 60, every session ends after an hour.

----
это ваша фотка?

Комментарии

Аватар пользователя dgastudio dgastudio 12 апреля 2017 в 11:14

ession.gc_maxlifetime

This value (default 1440 seconds) defines how long an unused PHP session will be kept alive. For example: A user logs in, browses through your application or web site, for hours, for days. No problem. As long as the time between his clicks never exceed 1440 seconds. It's a timeout value.

PHP's session garbage collector runs with a probability defined by session.gc_probability divided by session.gc_divisor. By default this is 1/100, which means that above timeout value is checked with a probability of 1 in 100.
session.cookie_lifetime

This value (default 0, which means until the browser's next restart) defines how long (in seconds) a session cookie will live. Sounds similar to session.gc_maxlifetime, but it's a completely different approach. This value indirectly defines the "absolute" maximum lifetime of a session, whether the user is active or not. If this value is set to 60, every session ends after an hour.

----
это ваша фотка?

Аватар пользователя Ritka Ritka 12 апреля 2017 в 10:57

Я правильно поняла, одно другому не мешает, тоесть то что я планирую сделать сессию пользователя на 100 дней, а проще, чтобы пользователь не логинился 100 дней, то будет правильно прописать в ini_set('session.gc_maxlifetime', 200000); и поставить ini_set('session.cookie_lifetime', 8640000)

А фотка и все мое при мне)))