Try to use:
Mage::app()->getCacheInstance()->flush();
It cleans cache storage, including memcached data. I'm using memcache and here is my shell script to clean cache data:
ini_set("display_errors", 1);
require '../app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getConfig()->init();
try {
Mage::app()->cleanCache(); // Clean Magento caches
Mage::app()->getCacheInstance()->flush(); // Clean cache storage
echo "\033[01;31m Cache instances were flushed successfully \033[0m \n";
flush();
} catch (Exception $e) {
echo "\nAn error was occurred: " . $e->getMessage() . "\n";
flush();
}
It's cleaning memcache storage. Memcache by default use one storage for cache and sessions. If you want remove all data from current memcached session use class (or or some child) Mage_Core_Model_Session_Abstract_Varien. There is a method unsetAll which removes all data from the session. The method also cleans memcached session if any.