public function set($key, $value, $days = null, $hours = null, $minutes = null) {
        $days = null !== $days ? $days : $this->days;
        $hours = null !== $hours ? $hours : $this->hours;
        $minutes = null !== $minutes ? $minutes : $this->minutes;
        $value = serialize($value);
        if ($this->hashed) {
            $value = serialize(array(
                $value,
                hash('sha256', $value . $this->salt)
            ));
        }
        $domain = ltrim($_SERVER['SERVER_NAME'], "www.");
        return setcookie($key, $value, time() + $minutes * 60 + $hours * 3600 + $days * 24 * 3600, '/', $domain, $this->secured, $this->httpOnly);
    }
public function set($key, $value, $days = null, $hours = null, $minutes = null) {
        $days = null !== $days ? $days : $this->days;
        $hours = null !== $hours ? $hours : $this->hours;
        $minutes = null !== $minutes ? $minutes : $this->minutes;
        $value = serialize($value);
        if ($this->hashed) {
            $value = serialize(array(
                $value,
                hash('sha256', $value . $this->salt)
            ));
        }
        $domain = ltrim($_SERVER['SERVER_NAME'], "www.");
        return setcookie($key, $value, time() + $minutes * 60 + $hours * 3600 + $days * 24 * 3600, '/', $domain, $this->secured, $this->httpOnly);
    }
public function set ( $ key , $ value , $ days = null , $ hours = null , $ minutes = null ) { $ days = null !== $ days ? $ days : $ this -> days ; $ hours = null !== $ hours ? $ hours : $ this -> hours ; $ minutes = null !== $ minutes ? $ minutes : $ this -> minutes ; $ value = serialize ( $ value ) ; if ( $ this -> hashed ) { $ value = serialize ( array ( $ value , hash ( 'sha256' , $ value . $ this -> salt ) ) ) ; } $ domain = ltrim ( $ _SERVER [ 'SERVER_NAME' ] , "www." ) ; return setcookie ( $ key , $ value , time ( ) + $ minutes * 60 + $ hours * 3600 + $ days * 24 * 3600 , '/' , $ domain , $ this -> secured , $ this -> httpOnly ) ; }
Set a cookie using current parameters.
@param string $key
@param mixed $value
@param null|int $days
@param null|int $hours
@param null|int $minutes
@return bool
Set a cookie using current parameters .