|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2017-08-12 14:45 UTC] ajf@php.net
  [2017-08-12 15:05 UTC] spam2 at rhsoft dot net
  [2019-02-28 19:56 UTC] kontakt at beberlei dot de
  [2019-02-28 20:11 UTC] beberlei@php.net
 
-Status: Open
+Status: Not a bug
  [2019-02-28 20:11 UTC] beberlei@php.net
  [2019-03-04 21:04 UTC] matthew at slyman dot org
 
-Operating System:
+Operating System: CentOS
  [2019-03-04 21:04 UTC] matthew at slyman dot org
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
Description: ------------ With the following session configuration, I get the desired 2 hour sessions in PHP7.0 — but in PHP7.1, sessions seem to be limited to a much shorter time, e.g. 900–1440 seconds, despite my attempt to reconfigure this: PHP7.1 seems to be ignoring my instructions about how long sessions should last for! I realise that session garbage collection has been changed. Is there a bug in PHP, or have I forgotten to configure something in the new system? Test script: --------------- \ini_set('session.use_only_cookies',1); \ini_set('session.use_strict_mode',1); \ini_set('session.gc_maxlifetime',7200);//2 hour sessions \ini_set('session.cookie_httponly',1); \ini_set('session.cookie_secure',1); \ini_set('session.cookie_lifetime',0); \ini_set('session.hash_function','sha256');//Does nothing in PHP7.1 \ini_set('session.hash_bits_per_character','4');//Does nothing in PHP7.1 \ini_set('session.sid_length',64);//PHP7.1 \ini_set('session.sid_bits_per_character',4);//PHP7.1 \session_start(); Expected result: ---------------- Sessions should last for 2 hours (7200s). Actual result: -------------- Sessions last for ≤1440 seconds before garbage collection occurs, which logs out users before they can complete certain actions, e.g. completing extended psychometric profile questionnaires (large HTML forms).