Commit 2a760672 authored by Alex Ne's avatar Alex Ne

Chek session string id

parent 495cb234
...@@ -76,13 +76,15 @@ class Session extends \X\Security\Crypto\IDEA { ...@@ -76,13 +76,15 @@ class Session extends \X\Security\Crypto\IDEA {
$In = new \X_Input(); $In = new \X_Input();
$this->session = $In->CookieValue($this->session_name, false) ?: $In->Request($this->session_name, "")->string(); $this->session = $In->CookieValue($this->session_name, false) ?: $In->Request($this->session_name, "")->string();
if (strlen($this->session) > 0) { if (strlen($this->session) > 0) {
if (is_array($session_data = $this->explode(gzuncompress($this->decrypt_b64($this->session))))) { if (is_string($SessionString = $this->decrypt_b64($this->session))) {
if (isset($session_data["cs"])) { if (is_array($session_data = $this->explode(gzuncompress($SessionString)))) {
if ($session_data["cs"] == $this->crypto_checksum($session_data)) { if (isset($session_data["cs"])) {
$this->session_data = $session_data; if ($session_data["cs"] == $this->crypto_checksum($session_data)) {
return true; $this->session_data = $session_data;
} else { return true;
throw new SessionChecksumError("Checksum Error", [get_defined_vars(), $this]); } else {
throw new SessionChecksumError("Checksum Error", [get_defined_vars(), $this]);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment