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
$name
The name of the
Auth
configuration 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
$options
Additional 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 = []) {
$defaults = ['clearSession' => true];
$options += $defaults;
$params = compact('name', 'options');
return Filters::run(get_called_class(), __FUNCTION__, $params, function($params) {
extract($params);
$config = static::_config($name);
$session = $config['session'];
if ($options['clearSession']) {
$session['class']::delete($session['key'], $session['options']);
}
static::adapter($name)->clear($options);
});
}