Skip to content
Snippets Groups Projects
Commit 49481f68 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #79166 by hunmonk: fixed session breakage.

parent 5b825a7b
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment