VaultPress::get_login_tokens PHP Method

get_login_tokens() public method

public get_login_tokens ( )
    function get_login_tokens()
    {
        // By default the login token is valid for 30 minutes.
        $nonce_life = $this->get_option('nonce_life') ? $this->get_option('nonce_life') : 1800;
        $salt = wp_salt('nonce') . md5($this->get_option('secret'));
        $nonce_life /= 2;
        return array('previous' => substr(hash_hmac('md5', 'vp-login' . ceil(time() / $nonce_life - 1), $salt), -12, 10), 'current' => substr(hash_hmac('md5', 'vp-login' . ceil(time() / $nonce_life), $salt), -12, 10));
    }
VaultPress