src/Auth.php
private function setRememberCookie($selector, $token, $expires) {
		$params = \session_get_cookie_params();

		if (isset($selector) && isset($token)) {
			$content = $selector . self::COOKIE_CONTENT_SEPARATOR . $token;
		}
		else {
			$content = '';
		}

		// save the cookie with the selector and token (requests a cookie to be written on the client)
		$cookie = new Cookie($this->rememberCookieName);
		$cookie->setValue($content);
		$cookie->setExpiryTime($expires);
		$cookie->setPath($params['path']);
		$cookie->setDomain($params['domain']);
		$cookie->setHttpOnly($params['httponly']);
		$cookie->setSecureOnly($params['secure']);
		$result = $cookie->save();

		if ($result === false) {
			throw new HeadersAlreadySentError();
		}

		// if we've been deleting the cookie above
		if (!isset($selector) || !isset($token)) {
			// attempt to delete a potential old cookie from versions v1.x.x to v6.x.x as well (requests a cookie to be written on the client)
			$cookie = new Cookie('auth_remember');
			$cookie->setPath((!empty($params['path'])) ? $params['path'] : '/');
			$cookie->setDomain($params['domain']);
			$cookie->setHttpOnly($params['httponly']);
			$cookie->setSecureOnly($params['secure']);
			$cookie->delete();
		}
	}
private function setRememberCookie($selector, $token, $expires) {
		$params = \session_get_cookie_params();

		if (isset($selector) && isset($token)) {
			$content = $selector . self::COOKIE_CONTENT_SEPARATOR . $token;
		}
		else {
			$content = '';
		}

		// save the cookie with the selector and token (requests a cookie to be written on the client)
		$cookie = new Cookie($this->rememberCookieName);
		$cookie->setValue($content);
		$cookie->setExpiryTime($expires);
		$cookie->setPath($params['path']);
		$cookie->setDomain($params['domain']);
		$cookie->setHttpOnly($params['httponly']);
		$cookie->setSecureOnly($params['secure']);
		$result = $cookie->save();

		if ($result === false) {
			throw new HeadersAlreadySentError();
		}

		// if we've been deleting the cookie above
		if (!isset($selector) || !isset($token)) {
			// attempt to delete a potential old cookie from versions v1.x.x to v6.x.x as well (requests a cookie to be written on the client)
			$cookie = new Cookie('auth_remember');
			$cookie->setPath((!empty($params['path'])) ? $params['path'] : '/');
			$cookie->setDomain($params['domain']);
			$cookie->setHttpOnly($params['httponly']);
			$cookie->setSecureOnly($params['secure']);
			$cookie->delete();
		}
	}
private function setRememberCookie ( $ selector , $ token , $ expires ) { $ params = \ session_get_cookie_params ( ) ; if ( isset ( $ selector ) && isset ( $ token ) ) { $ content = $ selector . self :: COOKIE_CONTENT_SEPARATOR . $ token ; } else { $ content = '' ; } // save the cookie with the selector and token (requests a cookie to be written on the client) $ cookie = new Cookie ( $ this -> rememberCookieName ) ; $ cookie -> setValue ( $ content ) ; $ cookie -> setExpiryTime ( $ expires ) ; $ cookie -> setPath ( $ params [ 'path' ] ) ; $ cookie -> setDomain ( $ params [ 'domain' ] ) ; $ cookie -> setHttpOnly ( $ params [ 'httponly' ] ) ; $ cookie -> setSecureOnly ( $ params [ 'secure' ] ) ; $ result = $ cookie -> save ( ) ; if ( $ result === false ) { throw new HeadersAlreadySentError ( ) ; } // if we've been deleting the cookie above if ( ! isset ( $ selector ) || ! isset ( $ token ) ) { // attempt to delete a potential old cookie from versions v1.x.x to v6.x.x as well (requests a cookie to be written on the client) $ cookie = new Cookie ( 'auth_remember' ) ; $ cookie -> setPath ( ( ! empty ( $ params [ 'path' ] ) ) ? $ params [ 'path' ] : '/' ) ; $ cookie -> setDomain ( $ params [ 'domain' ] ) ; $ cookie -> setHttpOnly ( $ params [ 'httponly' ] ) ; $ cookie -> setSecureOnly ( $ params [ 'secure' ] ) ; $ cookie -> delete ( ) ; } }
Sets or updates the cookie that manages the "remember me" token

@param string|null $selector the selector from the selector/token pair
@param string|null $token the token from the selector/token pair
@param int $expires the UNIX time in seconds which the token should expire at
@throws AuthError if an internal problem occurred (do *not* catch)
Sets or updates the cookie that manages the remember me token