$memcached = new Memcache;<br>$memcached->connect('localhost', 11211);<br><br>$key = 'key_' . $userid;<br>$privateKey = $memcached->get($key);<br>if (empty($privateKey) {<br> $privateKey = random(16);<br> $memcached->set($key, $privateKey);<br>}<br><br>$security = xxtea::encrypt($security, $privateKey);<br>setcookie('security', $security, 2592000);