get_sessions example

call_user_func( array( $manager, 'drop_sessions' ) );
    }

    /** * Retrieves all sessions for a user. * * @since 4.0.0 * * @return array Sessions for a user. */
    final public function get_all() {
        return array_values( $this->get_sessions() );
    }

    /** * Retrieves all sessions of the user. * * @since 4.0.0 * * @return array Sessions of the user. */
    abstract protected function get_sessions();

    


    /** * Retrieves a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to retrieve. * @return array|null The session, or null if it does not exist */
    protected function get_session( $verifier ) {
        $sessions = $this->get_sessions();

        if ( isset( $sessions[ $verifier ] ) ) {
            return $sessions[ $verifier ];
        }

        return null;
    }

    /** * Updates a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to update. * @param array $session Optional. Session. Omitting this argument destroys the session. */
Home | Imprint | This part of the site doesn't use cookies.