Commit 49481f68 authored by Dries's avatar Dries
Browse files

- Patch #79166 by hunmonk: fixed session breakage.

parent 5b825a7b
...@@ -615,12 +615,13 @@ function drupal_is_denied($type, $mask) { ...@@ -615,12 +615,13 @@ function drupal_is_denied($type, $mask) {
* *
* @return Object - the user object. * @return Object - the user object.
*/ */
function drupal_anonymous_user() { function drupal_anonymous_user($session = '') {
$user = new stdClass(); $user = new stdClass();
$user->uid = 0; $user->uid = 0;
$user->hostname = $_SERVER['REMOTE_ADDR']; $user->hostname = $_SERVER['REMOTE_ADDR'];
$user->roles = array(); $user->roles = array();
$user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user'; $user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
$user->session = $session;
return $user; return $user;
} }
......
...@@ -41,7 +41,7 @@ function sess_read($key) { ...@@ -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. // We didn't find the client's record (session has expired), or they are an anonymous user.
else { else {
$user = drupal_anonymous_user(); $user = drupal_anonymous_user($user->session);
} }
return $user->session; return $user->session;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment