- Patch #79166 by hunmonk: fixed session breakage.

5.x
Dries Buytaert 2006-08-18 19:24:52 +00:00
parent 5b825a7bfe
commit 49481f68f4
2 changed files with 3 additions and 2 deletions

View File

@ -615,12 +615,13 @@ function drupal_is_denied($type, $mask) {
*
* @return Object - the user object.
*/
function drupal_anonymous_user() {
function drupal_anonymous_user($session = '') {
$user = new stdClass();
$user->uid = 0;
$user->hostname = $_SERVER['REMOTE_ADDR'];
$user->roles = array();
$user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
$user->session = $session;
return $user;
}

View File

@ -41,7 +41,7 @@ function sess_read($key) {
}
// We didn't find the client's record (session has expired), or they are an anonymous user.
else {
$user = drupal_anonymous_user();
$user = drupal_anonymous_user($user->session);
}
return $user->session;