php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75140 session_id max length 255 is too long with filesystem save handler
Submitted: 2017-08-31 18:20 UTC Modified: 2017-08-31 18:33 UTC
From: sebastian dot rapetti at alice dot it Assigned:
Status: Open Package: Session related
PHP Version: 7.1.8 OS: Ubuntu 16.04
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-08-31 18:20 UTC] sebastian dot rapetti at alice dot it
Description:
------------
Hi

With default filesystem session handler:

When use a custom session_id length as provided from php 7.1 with the options session.sid_length and set the value near the max value (251..255), operation fails. OS cannot create the file for store session values because file name is too long.


Test script:
---------------
//session.sid_bits_per_character default value 4
//work, file system has the 5 characters for the sess_ file name part.
ini_set('session.sid_length', '250');
session_start();

//error from 251 to 255
ini_set('session.sid_length', '251');
session_start();

Expected result:
----------------
No error

Actual result:
--------------
With 251
Warning: session_start(): open(/var/lib/php/sessions/sess_ld3d1ome3tco3348uml0d4jpm4761n3i8lqui62t0aapf674jg3cjll4oehpmm1mi5u5r9jdaa3451f49eq541th9iom92qa062k6uviblshi8sdsbt4k1h82ae6c32gk75m87ub0176eugi812e9gbctkr2be8d51r5qno4racnjgtknf9jarcb3v4250p229mtueb1qecft82l9p16p0d1hh9ng7sfvibtvaj7ofbc16cphnc78j3kjmn, O_RDWR) failed: File name too long (36) in /home/sebastian/html/snippet/test.php on line 6

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-31 18:33 UTC] sebastian dot rapetti at alice dot it
-Summary: session_id max length off 255 is too long with filesystem save handler +Summary: session_id max length 255 is too long with filesystem save handler
 [2017-08-31 18:33 UTC] sebastian dot rapetti at alice dot it
Summary grammar error fixed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC