You are here

function soapclient::checkCookies in Salesforce Suite 5

Same name and namespace in other branches
  1. 5.2 includes/nusoap.orig.php \soapclient::checkCookies()

* checks all Cookies and delete those which are expired * *

Return value

always return true * @access private

1 call to soapclient::checkCookies()
soapclient::send in includes/nusoap.orig.php
send the SOAP message

File

includes/nusoap.orig.php, line 7140

Class

soapclient
soapclient higher level class for easy usage.

Code

function checkCookies() {
  if (sizeof($this->cookies) == 0) {
    return true;
  }
  $this
    ->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
  $curr_cookies = $this->cookies;
  $this->cookies = array();
  foreach ($curr_cookies as $cookie) {
    if (!is_array($cookie)) {
      $this
        ->debug('Remove cookie that is not an array');
      continue;
    }
    if (isset($cookie['expires']) && !empty($cookie['expires'])) {
      if (strtotime($cookie['expires']) > time()) {
        $this->cookies[] = $cookie;
      }
      else {
        $this
          ->debug('Remove expired cookie ' . $cookie['name']);
      }
    }
    else {
      $this->cookies[] = $cookie;
    }
  }
  $this
    ->debug('checkCookie: ' . sizeof($this->cookies) . ' cookies left in array');
  return true;
}