Example #1
0
            # ... without httponly flag
            setcookie($name, $value, $expires, '/', '', $secure);
        }
        # And log if in debug mode
        if (DEBUG_MODE) {
            $this->cookiesReceived[] = array('name' => $cookieName, 'value' => $cookieValue, 'attributes' => $attr);
        }
    }
}
/*****************************************************************
* Execute the request
******************************************************************/
# Initiate cURL wrapper request object with our cURL options
$fetch = new Request($toSet);
# And make the request
$document = $fetch->go($URL);
/*****************************************************************
* Handle aborted transfers
******************************************************************/
if ($fetch->abort) {
    switch ($fetch->abort) {
        # Do a redirection
        case 'redirect':
            # Proxy the location
            $location = proxyURL($fetch->headers['location'], $flag);
            # Do not redirect in debug mode
            if (DEBUG_MODE) {
                $fetch->redirected = '<a href="' . $location . '">' . $fetch->headers['location'] . '</a>';
                break;
            }
            # Go there