]> git.mxchange.org Git - friendica.git/commitdiff
Fix session size problems
authorMichael <heluecht@pirati.ca>
Wed, 25 Sep 2019 05:57:32 +0000 (05:57 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 25 Sep 2019 05:57:32 +0000 (05:57 +0000)
mod/dfrn_poll.php
src/Core/Session.php
src/Model/Profile.php

index 6c849cb807fa6b28059991e51e6207cb9a85aa84..d805bcfd49e7db8266beb3cb9e510a70899c775e 100644 (file)
@@ -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'];
index 8186c4745d1d1205a9c68f76760431ba1e1f0ef1..cccd6951de06a6ec1b3549f4a0232da8fc3b0f26 100644 (file)
@@ -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);
 
index 37f7028a51259cfb367137cfea6ce4228deb4bae..ab9b7fd00f50bb16ca280cc73fdafad9f83378b5 100644 (file)
@@ -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;