Exemple #1
0
function EnsureCookiesEnabled()
{
    /* As a first step try to set a cookie and read it on redirect, so that we can
     * warn the user explicitly if they appear to be refusing cookies. */
    if (!array_key_exists('test_cookie', $_COOKIE)) {
        if (array_key_exists('test_cookie', $_GET)) {
            page_header(_("Please enable cookies"));
            ?>
    <p>It appears that you don't have "cookies" enabled in your browser.</p>
    <p><strong>To continue, you must enable cookies</strong>.</p>
    <p>Please read <a href="http://www.google.com/cookies.html">this page from Google
    explaining how to do that</a>, then click the "back" button and try again.</p>
    <?php 
            page_footer();
            exit;
        } else {
            setcookie('test_cookie', '1', null, '/', person_cookie_domain(), false);
            header("Location: /login.php?" . $_SERVER['QUERY_STRING'] . "&test_cookie=1\n");
            exit;
        }
    }
}
Exemple #2
0
function person_signoff()
{
    setcookie('pb_person_id', '', 0, '/', person_cookie_domain());
    # Remove old style cookies left around too
    if (person_cookie_domain() != OPTION_WEB_DOMAIN) {
        setcookie('pb_person_id', '', 0, '/', '.' . OPTION_WEB_DOMAIN);
    }
}