Permalink
Browse files

Restore sessioning behavior to ragna, i.e. try to avoid disabling cac…

…he if the key doesn't exist
  • Loading branch information...
flack committed Jan 31, 2019
1 parent 94bc5d4 commit 90ae62f2ba680eaa25a4f85def2286aef5f69b87
Showing with 6 additions and 5 deletions.
  1. +4 −2 lib/midcom/services/_sessioning.php
  2. +2 −3 lib/midcom/services/auth/backend/simple.php
@@ -73,7 +73,7 @@ public function __construct()
*
* Returns null if the key
* is non-existent. Note, that this is not necessarily a valid non-existence
* check, as the sessioning system does allow null values. Use the exists function
* check, as the sessioning system does allow null values. Use the has function
* if unsure.
*
* @param string $key The key to query.
@@ -82,7 +82,9 @@ public function __construct()
*/
public function get($key, $default = null)
{
midcom::get()->cache->content->no_cache();
if ($this->has($key)) {
midcom::get()->cache->content->no_cache();
}
return parent::get($key, $default);
}
@@ -53,12 +53,11 @@ public function read_session(Request $request)
}
$this->session = new midcom_services_session($this->_cookie_id);
$userid = $this->session->get('userid');
if (empty($userid)) {
if (!$this->session->exists('userid')) {
return false;
}
return [
'userid' => $userid,
'userid' => $this->session->get('userid'),
'clientip' => $this->session->get('clientip'),
'timestamp' => $this->session->get('timestamp')
];

0 comments on commit 90ae62f

Please sign in to comment.