<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class CookieOperations
{
  
  public static function getVarValue($varname, $default = '')
  {
    if (isset($_COOKIE[$varname])) {
      return $_COOKIE[$varname];
    } else {
      return $default;
    }
  }

  public static function getAll()
  {
    $result = array();
    foreach ($_COOKIE as $key => $value) {
      $result[$key] = CookieOperations::getVarValue($key);
    }

    return $result;
  }

  
  public static function isDefined($varname)
  {
    return isset($_COOKIE[$varname]);
  }
}