From 9e813c08a499cbc6e2a5c130ce391023620a9c31 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 11 Jun 2003 20:42:31 +0000 Subject: - Bugfix: when clean URLs are enabled, the cookie path was not always set correctly when the user logged using the user block from within a subdirectory. Patch by Ulf Rompe. --- modules/user.module | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/user.module') diff --git a/modules/user.module b/modules/user.module index 6a6c1d91d..bc18b2b75 100644 --- a/modules/user.module +++ b/modules/user.module @@ -510,7 +510,7 @@ function user_auth_help_links() { /*** User features *********************************************************/ function user_login($edit = array(), $msg = "") { - global $user; + global $user, $base_url; /* ** If we are already logged on, go to the user page instead. @@ -591,11 +591,12 @@ function user_login($edit = array(), $msg = "") { ** that the session won't expire. */ + $path = preg_replace("/.+\/\/[^\/]+(.*)/", "\$1/", $base_url); if ($edit["remember_me"]) { - setcookie(session_name(), session_id(), time() + 3600 * 24 * 365); + setcookie(session_name(), session_id(), time() + 3600 * 24 * 365, $path); } else { - setcookie(session_name(), session_id()); + setcookie(session_name(), session_id(), FALSE, $path); } /* -- cgit v1.2.3