示例#1
0
 /**
  * Destroy a specific session
  * 
  * @param int $id Session Id
  * @return boolean
  */
 public function destroy($id)
 {
     // Destroy data
     if ($this->_storageType == self::STORAGE_TYPE_TABLE) {
         // In table storage
         try {
             $sessionRecord = $this->_storage->retrieveEntityById($this->_sessionContainer, $this->_sessionContainerPartition, $id);
             $this->_storage->deleteEntity($this->_sessionContainer, $sessionRecord);
             return true;
         } catch (Microsoft_WindowsAzure_Exception $ex) {
             return false;
         }
     } else {
         if ($this->_storageType == self::STORAGE_TYPE_BLOB) {
             // In blob storage
             try {
                 $this->_storage->deleteBlob($this->_sessionContainer, $this->_sessionContainerPartition . '/' . $id);
                 return true;
             } catch (Microsoft_WindowsAzure_Exception $ex) {
                 return false;
             }
         }
     }
 }