src/ministruts/Request.php
public function setCookie($name, $value, $expires = 0, $path = null) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!is_int($expires)) throw new IllegalTypeException('Illegal type of parameter $expires: '.gettype($expires));
        if ($expires < 0)      throw new InvalidArgumentException('Invalid argument $expires: '.$expires);

        $value = (string)$value;

        if ($path === null)
            $path = $this->getApplicationBaseUri();

        if (!is_string($path)) throw new IllegalTypeException('Illegal type of parameter $path: '.gettype($path));

        \setcookie($name, $value, $expires, $path);
    }
public function setCookie($name, $value, $expires = 0, $path = null) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!is_int($expires)) throw new IllegalTypeException('Illegal type of parameter $expires: '.gettype($expires));
        if ($expires < 0)      throw new InvalidArgumentException('Invalid argument $expires: '.$expires);

        $value = (string)$value;

        if ($path === null)
            $path = $this->getApplicationBaseUri();

        if (!is_string($path)) throw new IllegalTypeException('Illegal type of parameter $path: '.gettype($path));

        \setcookie($name, $value, $expires, $path);
    }
public function setCookie ( $ name , $ value , $ expires = 0 , $ path = null ) { if ( ! is_string ( $ name ) ) throw new IllegalTypeException ( 'Illegal type of parameter $name: ' . gettype ( $ name ) ) ; if ( ! is_int ( $ expires ) ) throw new IllegalTypeException ( 'Illegal type of parameter $expires: ' . gettype ( $ expires ) ) ; if ( $ expires < 0 ) throw new InvalidArgumentException ( 'Invalid argument $expires: ' . $ expires ) ; $ value = ( string ) $ value ; if ( $ path === null ) $ path = $ this -> getApplicationBaseUri ( ) ; if ( ! is_string ( $ path ) ) throw new IllegalTypeException ( 'Illegal type of parameter $path: ' . gettype ( $ path ) ) ; \ setcookie ( $ name , $ value , $ expires , $ path ) ; }
Setzt einen Cookie mit den angegebenen Daten.

@param  string $name            - Name des Cookies
@param  mixed  $value           - der zu speichernde Wert (wird zu String gecastet)
@param  int    $expires         - Lebenszeit des Cookies (0: bis zum Schliessen des Browsers)
@param  string $path [optional] - Pfad, fuer den der Cookie gueltig sein soll (default: whole domain)
Setzt einen Cookie mit den angegebenen Daten .