I have two different Controller. i am working with Zend Framework MVC
Controller 1. Set data
Controller 2. Get Data and display
So i did it simply:
Controller 1.
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$data = array('id'=>1,'Name'=>'Jonson');
$key = "PersonalDetail";
$memcache->set($key,$data,MEMCACHE_COMPRESSED,1200);
Controller 2.
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$key = "PersonalDetail";
$Data = $memcache->get($key);
var_dump($Data); //getting nothing.
I checked for the key if it is set or not. and i get this it is set in Controller 1 . but when i run Controller 2 code and then check key.. i didn't exists there anymore.
Is this happening because i am connecting memcache again to get data? or is there anyother thing happening?
Please help.