6.0.0-beta1
7/23/25

[#2766] Wrong parameters passed to memcache_set
Summary Wrong parameters passed to memcache_set
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners
Requester kevin_myer (at) iu13 (dot) org
Created 10/13/2005 (7223 days ago)
Due
Updated 10/13/2005 (7223 days ago)
Assigned
Resolved 10/13/2005 (7223 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/13/2005 01:17:32 PM Jan Schneider Comment #2
State ⇒ Resolved
Reply to this comment
Fixed, though I didn't enable compression because we didn't use it 
before either.
10/13/2005 12:58:59 AM kevin_myer (at) iu13 (dot) org Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Wrong parameters passed to memcache_set
Queue ⇒ Horde Framework Packages
Reply to this comment
Working through getting an understanding of the memcache 
sessionhandler tonight, I think the memcache_set call is missing a 
parameter.  $lifetime is setting the value for compression, not for 
the lifetime of the session, since the prototype for memcache_set is:



Memcache::set ( string key, mixed var [, int flag [, int expire]] )



It probably doesn't hurt anything, except the anticipated lifetime is 
ignored (I don't know what the default for expire would be).



Index: memcached.php

===================================================================

RCS file: /repository/framework/SessionHandler/SessionHandler/memcached.php,v

retrieving revision 1.8

diff -u -r1.8 memcached.php

--- memcached.php       1 Jun 2005 02:10:01 -0000       1.8

+++ memcached.php       13 Oct 2005 00:51:32 -0000

@@ -86,7 +86,7 @@

          $this->_connect();



          $lifetime = ini_get('session.gc_maxlifetime');

-        $result = @memcache_set($this->_db, $id, $session_data, $lifetime);

+        $result = @memcache_set($this->_db, $id, $session_data, 
MEMCACHE_COMPRESSED, $lifetime);



          if (!$result) {

              Horde::logMessage('Error writing session data (id = ' . 
$id . ')', __FILE__, __LINE__, PEAR_LOG_ERR);

Saved Queries