X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fsecurity%2FSessionManager.php;h=b8b8ab8d18ccad003f897c78072b12e94d410b22;hb=7be2a2d5f4078ba97b3281f2b5c33ae9bd337be5;hp=5897313043f0796fe8d2ad380b59206f212aebb8;hpb=c689e108639a4f6aa9e15928422e14db7cbe30ca;p=github%2Fshaarli%2FShaarli.git diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php index 58973130..b8b8ab8d 100644 --- a/application/security/SessionManager.php +++ b/application/security/SessionManager.php @@ -113,8 +113,6 @@ class SessionManager */ public function storeLoginInfo($clientIpId) { - // Generate unique random number (different than phpsessionid) - $this->session['uid'] = sha1(uniqid('', true) . '_' . mt_rand()); $this->session['ip'] = $clientIpId; $this->session['username'] = $this->conf->get('credentials.login'); $this->extendTimeValidityBy(self::$SHORT_TIMEOUT); @@ -154,7 +152,6 @@ class SessionManager public function logout() { if (isset($this->session)) { - unset($this->session['uid']); unset($this->session['ip']); unset($this->session['expires_on']); unset($this->session['username']); @@ -172,7 +169,7 @@ class SessionManager */ public function hasSessionExpired() { - if (empty($this->session['uid'])) { + if (empty($this->session['expires_on'])) { return true; } if (time() >= $this->session['expires_on']) { @@ -194,7 +191,7 @@ class SessionManager if ($this->conf->get('security.session_protection_disabled') === true) { return false; } - if ($this->session['ip'] == $clientIpId) { + if (isset($this->session['ip']) && $this->session['ip'] === $clientIpId) { return false; } return true;