<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body> <BR>
Hello,<BR>
<BR>
I'm using Cache::Memcached on the PERL side and the PECL libraries for PHP in PHP 4.x. The data objects are session data that I would like to share between both languages, however when I telnet straight into the memcache daemon and do gets on the keys, it appears that the data objects are stored in completely different formats. Do I have a setting wrong, is this a permanent limitation, wrong library or not enough RTFM? It works fine in either language. I'm just missing the cross-compatability. If someone could point me toward correct answer, it would be much appreciated. <BR>
<BR>
Thanks<BR>
<BR>
### PERL EXAMPLE<BR>
<BR>
use Cache::Memcached;<BR>require Digest::MD5;<BR>my $memd = new Cache::Memcached {<BR> 'servers' => [ "127.0.0.1:11211"],<BR> debug => 1<BR> };<BR>$memd->enable_compress(0);<BR>$sess_id = "d116f2af6b07deaac588c8c34cca919b";<BR>$session->{'first'} = "john";<BR>$session->{'last'} = "smith";<BR>$session->{'session_id'} = $sess_id;<BR> <BR>$memd->set("$sess_id", $session,60);<BR>
<BR>
<BR>
### MEMCACHE RESULT<BR>
<BR>
telnet 127.0.0.1 11211<BR>Trying 127.0.0.1...<BR>Connected to localhost.localdomain (127.0.0.1).<BR>Escape character is '^]'.<BR>get d116f2af6b07deaac588c8c34cca919b<BR>VALUE d116f2af6b07deaac588c8c34cca919b 1 85<BR>
d116f2af6b07deaac588c8c34cca919b<BR>session_id<BR>johnfirst<BR>smithlast<BR>END<BR>
<BR>
### PHP EXAMPLE<BR>
<BR>
$memcache = new Memcache;<BR>$memcache->connect('127.0.0.1', 11211) or die ("Could not connect");<BR>$sess_id = "d116f2af6b07deaac588c8c34cca919b";<BR>$session->first = "john";<BR>$session->last = "smith";<BR>$session->session_id = "$sess_id";<BR>$memcache->set($sess_id,$session,false,900);<BR>
<BR>
### MEMCACHE RESULT<BR>
<BR>
get d116f2af6b07deaac588c8c34cca919b<BR>VALUE d116f2af6b07deaac588c8c34cca919b 1 123<BR>O:8:"stdClass":3:{s:5:"first";s:4:"john";s:4:"last";s:5:"smith";s:10:"session_id";s:32:"d116f2af6b07deaac588c8c34cca919b";}<BR>END<BR><br /><hr />Change is good. See what's different about Windows Live Hotmail. <a href='www.windowslive-hotmail.com/learnmore/default.html?locale=en-us&ocid=RMT_TAGLM_HMWL_reten_changegood_0607' target='_new'>Check it out!</a></body>
</html>