php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58379 Session handler and large sessions
Submitted: 2008-10-15 16:33 UTC Modified: 2008-12-25 10:43 UTC
From: cory dot meyer at gmail dot com Assigned:
Status: Closed Package: memcache (PECL)
PHP Version: 4.3.10 OS: Debian 3.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cory dot meyer at gmail dot com
New email:
PHP Version: OS:

 

 [2008-10-15 16:33 UTC] cory dot meyer at gmail dot com
Description:
------------
The session handler doesn't support sessions larger than memcached's object/slab size.  Default maximum object size is 1mb.
  
Only error returned is: <error>PHP Warning:  Unknown(): Failed to write session data (memcache). Please verify that the current setting of session.save_path is correct</error>

One possible solution is to define a "max object limit" in the session handler and break apart the session between multiple memcache objects.

Another solution would be to enable compression support in the session handler which would suppress these issues.  

Reproduce code:
---------------
session_start();

$my_string='';

for ($count=0; $count <= 1024*2048; $count++) {
        // printable ascii 32 - 126
        $my_string.= chr(rand(32,126));
}
$_SESSION['big_string']= $my_string;



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-25 10:43 UTC] mikael at synd dot info
* Added INI directive memcache.compress_threshold (default 20kb) which controls the default compression threshold
 * Added E_NOTICE log message when receiving out-of-memory or object-to-large errors

The changes are committed to the 3.0.x branch and will show up in the next release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 22:01:32 2024 UTC