code/libraries/joomlatools/library/http/cookie/cookie.php
public function setExpire($expire)
    {
        // Convert expiration time to a Unix timestamp
        if ($expire instanceof DateTime) {
            $expire = $expire->format('U');
        }

        if (!is_numeric($expire))
        {
            $expire = strtotime($expire);

            if ($expire === false || $expire === -1) {
                throw new InvalidArgumentException('The cookie expiration time is not valid.');
            }
        }

        $this->_expire = $expire;
        return $this;
    }
public function setExpire($expire)
    {
        // Convert expiration time to a Unix timestamp
        if ($expire instanceof DateTime) {
            $expire = $expire->format('U');
        }

        if (!is_numeric($expire))
        {
            $expire = strtotime($expire);

            if ($expire === false || $expire === -1) {
                throw new InvalidArgumentException('The cookie expiration time is not valid.');
            }
        }

        $this->_expire = $expire;
        return $this;
    }
public function setExpire ( $ expire ) { // Convert expiration time to a Unix timestamp if ( $ expire instanceof DateTime ) { $ expire = $ expire -> format ( 'U' ) ; } if ( ! is_numeric ( $ expire ) ) { $ expire = strtotime ( $ expire ) ; if ( $ expire === false || $ expire === - 1 ) { throw new InvalidArgumentException ( 'The cookie expiration time is not valid.' ) ; } } $ this -> _expire = $ expire ; return $ this ; }
Set the cookie expiration time

@param integer|string|\DateTime $expire The expiration time of the cookie
@throws \InvalidArgumentException    If the cookie expiration time is not valid
@return KHttpCookie
Set the cookie expiration time