summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/pluggable-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-25 08:05:45 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-25 08:05:45 +0000
commit6a0fae2afb9614d0e85ea1838611c77922b752ae (patch)
tree72bf1cc1fc6e0745b94ee5164bcccc24063817a5 /wp-inst/wp-includes/pluggable-functions.php
parent741bb24c7abd93a832797dca5159457912a55901 (diff)
Merge changes from WP Core.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@73 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/pluggable-functions.php')
-rw-r--r--wp-inst/wp-includes/pluggable-functions.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/wp-inst/wp-includes/pluggable-functions.php b/wp-inst/wp-includes/pluggable-functions.php
index c5cfa96..c6cb5cc 100644
--- a/wp-inst/wp-includes/pluggable-functions.php
+++ b/wp-inst/wp-includes/pluggable-functions.php
@@ -174,7 +174,7 @@ function wp_redirect($location) {
endif;
if ( !function_exists('wp_setcookie') ) :
-function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') {
+function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
if ( !$already_md5 )
$password = md5( md5($password) ); // Double hash the password in the cookie.
@@ -191,12 +191,17 @@ function wp_setcookie($username, $password, $already_md5 = false, $home = '', $s
$cookiehash = md5($siteurl);
}
- setcookie(USER_COOKIE, $username, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
- setcookie(PASS_COOKIE, $password, time() + 31536000, $cookiepath, COOKIE_DOMAIN);
+ 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, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
- setcookie(PASS_COOKIE, $password, time() + 31536000, $sitecookiepath, COOKIE_DOMAIN);
+ setcookie(USER_COOKIE, $username, $expire, $sitecookiepath, COOKIE_DOMAIN);
+ setcookie(PASS_COOKIE, $password, $expire, $sitecookiepath, COOKIE_DOMAIN);
}
}
endif;