- 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.
4.2.x
Dries Buytaert 2003-06-11 20:42:31 +00:00
parent a8c6f0d0af
commit 9e813c08a4
2 changed files with 8 additions and 6 deletions

View File

@ -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);
}
/*

View File

@ -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);
}
/*