Extends
lithium\core\Adaptable
Removes session information for the given configuration, and allows the configuration's
adapter to perform any associated cleanup tasks.
Parameters
- string $name The name of the `Auth` configuration to clear the login information for. Calls the `clear()` method of the given configuration's adapter, and removes the information in the session key used by this configuration.
- array $options Additional options used when clearing the authenticated session. See each adapter's `clear()` method for all available options. Global options: - `'clearSession'` _boolean_: If `true` (the default), session data for the specified configuration is removed, otherwise it is retained.
Returns
voidSource
public static function clear($name, array $options = array()) {
$defaults = array('clearSession' => true);
$options += $defaults;
return static::_filter(__FUNCTION__, compact('name', 'options'), function($self, $params) {
extract($params);
$config = $self::invokeMethod('_config', array($name));
$session = $config['session'];
if ($options['clearSession']) {
$session['class']::delete($session['key'], $session['options']);
}
$self::adapter($name)->clear($options);
});
}