Created
June 18, 2018 11:59
-
-
Save lonalore/e2da5dc08b3779bb8c91cf5eee9cd905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Some distributions of Linux (most notably Debian) ship their PHP | |
* installations with garbage collection (gc) disabled. This depends on | |
* PHP's garbage collection for clearing sessions, ensure that garbage | |
* collection occurs by using the most common settings. | |
*/ | |
ini_set('session.gc_probability', 1); | |
ini_set('session.gc_divisor', 100); | |
/** | |
* Set session lifetime (in seconds), i.e. the time from the user's last visit | |
* to the active session may be deleted by the session garbage collector. When | |
* a session is deleted, authenticated users are logged out, and the contents | |
* of the user's $_SESSION variable is discarded. | |
*/ | |
ini_set('session.gc_maxlifetime', 200000); | |
/** | |
* Set session cookie lifetime (in seconds), i.e. the time from the session is | |
* created to the cookie expires, i.e. when the browser is expected to discard | |
* the cookie. The value 0 means "until the browser is closed". | |
*/ | |
ini_set('session.cookie_lifetime', 2000000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment