Время жизни сессии под апачем

Как можно узнать время жизни сессии под апачем и пхп? и как можно установить/изменить это значение?

1 ответов


session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up.

Note: If you are using the default file-based session handler, your filesystem must keep track of access times (atime). Windows FAT does not so you will have to come up with another way to handle garbage collecting your session if you are stuck with a FAT filesystem or any other fs where atime tracking is not available. Since PHP 4.2.3 it has used mtime (modified date) instead of atime. So, you won't have problems with filesystems where atime tracking is not available.

Настраивается в php.ini


Установить время жизни можно не только в php.ini а в .htacccess; для этого в .htaccess-файл который находится в корне сайта достаточно внести следующую строку - php_value session.gc_maxlifetime "время сессии в секундах".