--TEST-- ini_set('memcache.session_redundancy') --SKIPIF-- --FILE-- delete($balanceKey1); $memcache1->delete($balanceKey2); $memcache2->delete($balanceKey1); $memcache2->delete($balanceKey2); // Test set session_id($balanceKey1); session_start(); $_SESSION['key'] = 'Test1'; session_write_close(); $result1 = $memcache1->get($balanceKey1); $result2 = $memcache2->get($balanceKey1); var_dump($result1); var_dump($result2); // Test delete session_id($balanceKey1); session_start(); session_destroy(); $result1 = $memcache1->get($balanceKey1); $result2 = $memcache2->get($balanceKey1); var_dump($result1); var_dump($result2); // Test lost session on server1 session_id($balanceKey1); session_start(); $_SESSION['key'] = 'Test2'; session_write_close(); unset($_SESSION['key']); $result = $memcache1->delete($balanceKey1); var_dump($result); session_id($balanceKey1); @session_start(); var_dump($_SESSION); session_write_close(); // Test lost session on server2 session_id($balanceKey2); session_start(); $_SESSION['key'] = 'Test3'; session_write_close(); unset($_SESSION['key']); $result = $memcache2->delete($balanceKey1); var_dump($result); session_id($balanceKey2); session_start(); var_dump($_SESSION); session_write_close(); ob_flush(); ?> --EXPECTF-- string(16) "key%sTest1%s" string(16) "key%sTest1%s" bool(false) bool(false) bool(true) array(1) { ["key"]=> string(5) "Test2" } bool(true) array(1) { ["key"]=> string(5) "Test3" }