web/wp-content/plugins/wp-native-php-sessions/callbacks.php
/**
 * Reads an entire session from the database (internal use only).
 *
 * Also initializes the $user object for the user associated with the session.
 * This function is registered with session_set_save_handler() to support
 * database-backed sessions. It is called on every page load when PHP sets
 * up the $_SESSION superglobal.
 *
 * This function is an internal function and must not be called directly.
 * Doing so may result in logging out the current user, corrupting session data
 * or other unexpected behavior. Session data must always be accessed via the
 * $_SESSION superglobal.
 *
 * @param $sid
 *   The session ID of the session to retrieve.
 *
 * @return
 *   The user's session, or an empty string if no session exists.
 */
Reads an entire session from the database (internal use only).
Also initializes the $user object for the user associated with the session.
This function is registered with session_set_save_handler() to support
database-backed sessions. It is called on every page load when PHP sets
up the $_SESSION superglobal.

This function is an internal function and must not be called directly.
Doing so may result in logging out the current user, corrupting session data
or other unexpected behavior. Session data must always be accessed via the
$_SESSION superglobal.

@param $sid
The session ID of the session to retrieve.

@return
The user's session, or an empty string if no session exists.
Reads an entire session from the database ( internal use only ) . Also initializes the $user object for the user associated with the session . This function is registered with session_set_save_handler () to support database - backed sessions . It is called on every page load when PHP sets up the $_SESSION superglobal . This function is an internal function and must not be called directly . Doing so may result in logging out the current user corrupting session data or other unexpected behavior . Session data must always be accessed via the $_SESSION superglobal . @param $sid The session ID of the session to retrieve . @return The user ' s session or an empty string if no session exists .
function _pantheon_session_read( $sid ) {
	$insecure_session_name = substr( session_name(), 1 );
	if ( ! isset( $_COOKIE[ session_name() ] ) && ! isset( $_COOKIE[ $insecure_session_name ] ) ) {
		return '';
	}
	$session = \Pantheon_Sessions\Session::get_by_sid( $sid );
	if ( $session ) {
		return $session->get_data();
	} else {
		return '';
	}
}
function _pantheon_session_read ( $ sid ) { $ insecure_session_name = substr ( session_name ( ) , 1 ) ; if ( ! isset ( $ _COOKIE [ session_name ( ) ] ) && ! isset ( $ _COOKIE [ $ insecure_session_name ] ) ) { return '' ; } $ session = \ Pantheon_Sessions \ Session :: get_by_sid ( $ sid ) ; if ( $ session ) { return $ session -> get_data ( ) ; } else { return '' ; } }
Reads an entire session from the database (internal use only).
Reads an entire session from the database ( internal use only ) .
// Handle the case of first time visitors and clients that don't store // cookies (eg. web crawlers).