Closed cr1st1an closed 11 years ago
You're close. The docs should be more clear on this.
EpiSession::employ(
array(
EpiSession::MEMCACHED,
getConfig()->get('memcached')->host,
getConfig()->get('memcached')->port,
getConfig()->get('memcached')->compress,
getConfig()->get('memcached')->expiry
)
);
I don't believe that works, it defaults to a PHP session, since the employ function on Epi Session only reads the first parameter:
From EpiSession.php
public static function employ(/*$const*/)
{
if(func_num_args() === 1)
{
self::$employ = func_get_arg(0);
}
return self::$employ;
}
function getSession()
{
$employ = EpiSession::employ();
if($employ && class_exists($employ))
return EpiSession::getInstance($employ);
elseif(class_exists(EpiSession::PHP))
return EpiSession::getInstance(EpiSession::PHP);
elseif(class_exists(EpiSession::APC))
return EpiSession::getInstance(EpiSession::APC);
elseif(class_exists(EpiSession::MEMCACHED))
return EpiSession::getInstance(EpiSession::MEMCACHED);
else
EpiException::raise(new EpiSessionException('Could not determine which session handler to load', 404));
}
@cr1st1an You're right. I had a local modification which wasn't pushed to master. Do you mind updating and confirming if this issue is resolved using the code I provided in my earlier comment?
Awesome, thanks! It's working now. I did a bit of cleanup for the EpiCache_Memcached and EpiSession_Memcached classes, including the expiry issue that ignores the setting. Will send a pull request.
Hi! I believe EpiCache has this same issue
Bump!
I'm not sure I understand how to use the EpiSession with memcached:
Any pointers?