diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-12 09:17:44 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-09-12 09:17:44 +0000 |
commit | 5aa6ad6448578b22f8f1b10b88df9083f965868b (patch) | |
tree | 6b3be2acbf307e7ea262f6d9d3381bdda46a9a28 /wp-includes | |
parent | 91c2d227e28206ec57d2b857822d90b11af256d3 (diff) | |
download | wordpress-mu-5aa6ad6448578b22f8f1b10b88df9083f965868b.tar.gz wordpress-mu-5aa6ad6448578b22f8f1b10b88df9083f965868b.tar.xz wordpress-mu-5aa6ad6448578b22f8f1b10b88df9083f965868b.zip |
Set the cookie path to the current site's path (fixes #125)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@737 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r-- | wp-includes/pluggable.php | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 93294a4..2750942 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -294,40 +294,22 @@ function wp_setcookie($username, $password, $already_md5 = false, $home = '', $s if ( !$already_md5 ) $password = md5( md5($password) ); // Double hash the password in the cookie. - if ( empty($home) ) - $cookiepath = COOKIEPATH; - else - $cookiepath = preg_replace('|https?://[^/]+|i', '', $home . '/' ); - - if ( empty($siteurl) ) { - $sitecookiepath = SITECOOKIEPATH; - $cookiehash = COOKIEHASH; - } else { - $sitecookiepath = preg_replace('|https?://[^/]+|i', '', $siteurl . '/' ); - $cookiehash = md5($siteurl); - } - if ( $remember ) $expire = time() + 31536000; else $expire = 0; - setcookie(USER_COOKIE, $username, $expire, $cookiepath, COOKIE_DOMAIN); - setcookie(PASS_COOKIE, $password, $expire, $cookiepath, COOKIE_DOMAIN); - - if ( $cookiepath != $sitecookiepath ) { - setcookie(USER_COOKIE, $username, $expire, $sitecookiepath, COOKIE_DOMAIN); - setcookie(PASS_COOKIE, $password, $expire, $sitecookiepath, COOKIE_DOMAIN); - } + global $base; + setcookie(USER_COOKIE, $username, $expire, $base, COOKIE_DOMAIN); + setcookie(PASS_COOKIE, $password, $expire, $base, COOKIE_DOMAIN); } endif; if ( !function_exists('wp_clearcookie') ) : function wp_clearcookie() { - setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); - setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); - setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); - setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); + global $base; + setcookie(USER_COOKIE, ' ', time() - 31536000, $base, COOKIE_DOMAIN); + setcookie(PASS_COOKIE, ' ', time() - 31536000, $base, COOKIE_DOMAIN); } endif; |