Validate with the token stored in session.

@param string $token
@return bool
185976
public function validateCsrfToken($token) {
		return (
			isset($_SESSION[$this->csrfTokenSessionKey])
			&& $_SESSION[$this->csrfTokenSessionKey] === $token
		);
	}
175361
public function exists($token)
    {
        $reset = PasswordReset::where('token', $token)->first();
        return $reset and ! $reset->isExpired();
    }
1237326
public function verifyEmailToken($token)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = false;
		$token = base64_decode($token);
		$vals = array(
			'token_hash' => $this->db->quoteValue(sha1($token)),
		);
		$query = Str::quickTemp('SELECT * FROM `email_tokens`
			WHERE `token_hash` = [::token_hash::]', $vals);
		$rows = $this->db->query($query)[0];
		$this->debug->table($rows, 'rows');
		if ($rows) {
			// found token in table
			$return = $rows[0]['userid'];
			// remove the token
			$where = $vals;
			$this->db->rowMan('email_tokens', null, $where);
			$this->log('pwForgotTokenSuccess', $rows[0]['userid']);
		} else {
			$this->log('pwForgotTokenFail');
		}
		$this->debug->groupEnd();
		return $return;
	}
1059659
public function validateToken($token)
    {
        /*
         | Return false if given token is not string
         */
        if (!is_string($token)) {
            return false;
        }

        if (isset($this->storage->csrf_tokens[$token])) {
            $this->storage->csrf_tokens = [trim($token) => null];

            return true;
        }

        return false;
    }
1183920
private function tokenExists($token)
    {
        $tokenData = $this->getTokenData($token);
        if ($tokenData == false) {
            return false;
        }

        return $tokenData == false ? true : false;
    }
834460
public static function verify($token, $strict = false)
    {

        if (!Session::getInstance()->has('__bow.csrf')) {
            return false;
        }

        $csrf = Session::getInstance()->get('__bow.csrf');

        if ($token !== $csrf['token']) {
            return false;
        }

        $status = true;

        if ($strict) {
            $status = $status && static::CsrfExpirated(time());
        }

        return $status;
    }
1193157
private function isConstantToken($token)
    {
        return $token == T_CONSTANT_ENCAPSED_STRING || $token == T_STRING || $token == T_LNUMBER || $token == T_DNUMBER;
    }
326096
public function verify($token)
    {
        $result = $this->find('token', compact('token'))->firstOrFail();

        $event = $this->dispatchEvent('Muffin/Tokenize.beforeVerify', ['token' => $result]);
        if ($event->isStopped()) {
            return false;
        }

        if (!empty($result['foreign_data'])) {
            $table = $this->foreignTable($result);
            $fields = $result['foreign_data'];
            $conditions = [(string)$table->getPrimaryKey() => $result['foreign_key']];
            $table->updateAll($fields, $conditions);
        }

        $result->set('status', true);
        $this->save($result);

        $this->dispatchEvent('Muffin/Tokenize.afterVerify', ['token' => $result]);

        return $result;
    }
1136984
public function contains(string $token): bool
    {
        $this->tokenize();
        return in_array($token, $this->tokens);
    }
403830
public static function check($key, $token)
    {

        if (isset($_SESSION[$key]) && $token === $_SESSION[$key]) {
            unset($_SESSION[$key]);
            return true;
        }

        return false;
    }
144953
public static function isPasswordResetTokenValid($token)
    {
        if (empty($token)) {
            return false;
        }
        $timestamp = (int)substr($token, strrpos($token, '_') + 1);
        $expire = UsersModule::module()->passwordResetTokenExpire;
        return $timestamp + $expire >= time();
    }
834224
public function verify($token = null) {
        if (!$token) {
            $data = $this->requestVerificationToken();
            $token = $data['token'];
        }

        return $this->_post('servers/' . $this->id . '/verify', ['token' => $token]);
    }
1275812
protected function validCsrf($token, $request)
    {
        return isset($token['csrf']) && hash_equals(
            $token['csrf'], (string) $request->header('X-CSRF-TOKEN')
        );
    }
787238
protected function store_token($token) {
        global $SESSION;

        $this->accesstoken = $token;
        $name = $this->get_tokenname();

        if ($token !== null) {
            $SESSION->{$name} = $token;
        } else {
            unset($SESSION->{$name});
        }
    }
976949
public function contains( $token )
	{
		$token = (string) $token;
		$this->__validate( $token );

		return $this->__contains( $token );
	}
694142
private function _validate($token)
    {

        $request = $this->_httpClient->createRequest('POST', $this->_tokenServiceUrl . 'validate');
        $postBody = $request->getBody();


        // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface
        $postBody->setField('service', $this->_appID);
        $postBody->setField('token', $token);

        // Send the POST request
        try {
            $response = $this->_httpClient->send($request);
        } catch (ClientException $e) {
            return "BAD_TOKEN";
        } catch (ServerException $e) {
            return "SERVER_ERROR";
        }

        return $response->json();

    }
316719
protected function validateStructure($token)
    {
        $parts = explode('.', $token);

        if (count($parts) !== 3) {
            throw new TokenInvalidException('Wrong number of segments');
        }

        $parts = array_filter(array_map('trim', $parts));

        if (count($parts) !== 3 || implode('.', $parts) !== $token) {
            throw new TokenInvalidException('Malformed token');
        }

        return $token;
    }