Make WordPress Core

Changeset 2725


Ignore:
Timestamp:
07/18/2005 07:55:24 PM (19 years ago)
Author:
matt
Message:

Let advanced users override cookies.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable-functions.php

    r2711 r2725  
    192192    }
    193193
    194     setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $cookiepath);
    195     setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $cookiepath);
     194    setcookie(USER_COOKIE, $username, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
     195    setcookie(PASS_COOKIE, $password, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
    196196
    197197    if ( $cookiepath != $sitecookiepath ) {
    198         setcookie('wordpressuser_'. $cookiehash, $username, time() + 31536000, $sitecookiepath);
    199         setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $sitecookiepath);
     198        setcookie(USER_COOKIE, $username, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
     199        setcookie(PASS_COOKIE, $password, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
    200200    }
    201201}
     
    204204if ( !function_exists('wp_clearcookie') ) :
    205205function wp_clearcookie() {
    206     setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
    207     setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
    208     setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
    209     setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
     206    setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
     207    setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
     208    setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
     209    setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
    210210}
    211211endif;
  • trunk/wp-includes/vars.php

    r2436 r2725  
    107107}
    108108
    109 // Path for cookies
    110 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
    111 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );
    112 
    113109?>
  • trunk/wp-settings.php

    r2706 r2725  
    5757if ( defined('CUSTOM_USER_META_TABLE') )
    5858    $wpdb->usermeta = CUSTOM_USER_META_TABLE;
    59 
     59   
    6060// We're going to need to keep this around for a few months even though we're not using it internally
    6161
     
    104104    define('COOKIEHASH', $cookiehash);
    105105endif;
     106
     107if ( !defined('USER_COOKIE') )
     108    define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
     109if ( !defined('PASS_COOKIE') )
     110    define('PASS_COOKIE', 'wordpresspass_'. COOKIEHASH);
     111if ( !defined('COOKIEPATH') )
     112    define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
     113if ( !defined('SITECOOKIEPATH') )
     114    define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );
     115if ( !defined('COOKIE_DOMAIN') )
     116    define('COOKIE_DOMAIN', false);
    106117
    107118require (ABSPATH . WPINC . '/vars.php');
Note: See TracChangeset for help on using the changeset viewer.