Stash::_get_stash_cookie PHP Метод

    private function _get_stash_cookie()
    {
        $cookie_data = @unserialize($this->EE->input->cookie($this->stash_cookie));
        if ($cookie_data !== FALSE) {
            // make sure the cookie hasn't been monkeyed with
            if (isset($cookie_data['id']) && isset($cookie_data['dt'])) {
                // make sure we have a valid 40-character SHA-1 hash
                if ((bool) preg_match('/^[0-9a-f]{40}$/i', $cookie_data['id'])) {
                    // make sure we have a valid timestamp
                    if ((int) $cookie_data['dt'] === $cookie_data['dt'] && $cookie_data['dt'] <= PHP_INT_MAX && $cookie_data['dt'] >= ~PHP_INT_MAX) {
                        return $cookie_data;
                    }
                }
            }
        }
        return FALSE;
    }