lithium\security\Auth::clear()
Removes session information for the given configuration, and allows the configuration's adapter to perform any associated cleanup tasks.
Parameters
-
string
$nameThe name of the
Authconfiguration to clear the login information for. Calls theclear()method of the given configuration's adapter, and removes the information in the session key used by this configuration. -
array
$optionsAdditional options used when clearing the authenticated session. See each adapter's
clear()method for all available options. Global options:'clearSession'boolean: Iftrue(the default), session data for the specified configuration is removed, otherwise it is retained.
Returns
voidFilter
This method can be filtered.
Source
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);
});
}