You are here

function nusoapclient::checkCookies in Salesforce Suite 5

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

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

Return value

always return true * @access private

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

File

includes/nusoap.php, line 7179

Class

nusoapclient
nusoapclient 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;
}