Sesion.Clear() vs Sesión.Eliminar todo()
Hay una diferencia entre Session.Clear()
y Session.RemoveAll()
?
Las descripciones y las páginas de documentación parecen decir exactamente lo mismo, pero Estoy asumiendo que debe haber alguna razón para crear dos funciones, ¿estoy en lo cierto?
41
2 answers
Para ser salvo siempre puedes llamarlos a todos así....
Session.Clear()
Session.Abandon()
Session.RemoveAll()
VB.NET por ejemplo, estoy seguro de que todo lo que necesita hacer es colocar el ; al final de cada uno de ellos. Esto hizo el truco para mí, ya que tuve algunos problemas con mi sesión anterior donde no se eliminaron.
-5
Author: Etienne,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 08:29:12
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 08:29:12
Absolutamente lo mismo. RemoveAll
llama a Clear
internamente. Del reflector:
public sealed class HttpSessionState : ICollection, IEnumerable
{
...
[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void RemoveAll()
{
this.Clear();
}
...
}
118
Author: Darin Dimitrov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 08:24:39
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 08:24:39