BP_Core_Members_Switching::remember()

Returns whether or not the current logged in user is being remembered in the form of a persistent browser cookie (ie. they checked the ‘Remember Me’ check box when they logged in). This is used to persist the ‘remember me’ value when the user switches to another user.

Description

Return

(bool) Whether the current user is being 'remembered' or not.

Source

File: bp-members/classes/class-bp-core-members-switching.php

	public static function remember() {
		/** This filter is documented in wp-includes/pluggable.php */
		$cookie_life = apply_filters( 'auth_cookie_expiration', 172800, get_current_user_id(), false );
		$current     = wp_parse_auth_cookie( '', 'logged_in' );

		// Here we calculate the expiration length of the current auth cookie and compare it to the default expiration.
		// If it's greater than this, then we know the user checked 'Remember Me' when they logged in.
		return ( ( $current['expiration'] - time() ) > $cookie_life );
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.