From 6a376c29d85cb3e3b5ccf99bc604da472a7191c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 25 Sep 2019 05:57:32 +0000 Subject: [PATCH] Fix session size problems --- mod/dfrn_poll.php | 4 ++-- src/Core/Session.php | 4 +++- src/Model/Profile.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 6c849cb80..d805bcfd4 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -114,7 +114,7 @@ function dfrn_poll_init(App $a) $_SESSION['remote'] = []; } - $_SESSION['remote'][] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']]; + $_SESSION['remote'][$r[0]['uid']] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid']]; $_SESSION['visitor_id'] = $r[0]['id']; $_SESSION['visitor_home'] = $r[0]['url']; @@ -521,7 +521,7 @@ function dfrn_poll_content(App $a) $_SESSION['remote'] = []; } - $_SESSION['remote'][] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']]; + $_SESSION['remote'][$r[0]['uid']] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid']]; $_SESSION['visitor_id'] = $r[0]['id']; $_SESSION['visitor_home'] = $r[0]['url']; $_SESSION['visitor_visiting'] = $r[0]['uid']; diff --git a/src/Core/Session.php b/src/Core/Session.php index 8186c4745..cccd6951d 100644 --- a/src/Core/Session.php +++ b/src/Core/Session.php @@ -128,7 +128,9 @@ class Session continue; } - $_SESSION['remote'][] = ['cid' => $contact['id'], 'uid' => $contact['uid'], 'url' => $_SESSION['my_url']]; + /// @todo Change it to this format to save space + // $_SESSION['remote'][$contact['uid']] = $contact['id']; + $_SESSION['remote'][$contact['uid']] = ['cid' => $contact['id'], 'uid' => $contact['uid']]; } DBA::close($remote_contacts); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 37f7028a5..ab9b7fd00 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -1130,7 +1130,7 @@ class Profile continue; } - $_SESSION['remote'][] = ['cid' => $contact['id'], 'uid' => $contact['uid'], 'url' => $visitor['url']]; + $_SESSION['remote'][$contact['uid']] = ['cid' => $contact['id'], 'uid' => $contact['uid']]; } $a->contact = $visitor;