Differences Between Session.Clear and Session.Abandon?

Session.Clear()

  • Doesn’t trigger Session_End in Global.asax.
  • Doesn’t change Session ID.
  • Will remove all keys and objects in stored in the session.

Session.Abandon()

  • Trigger Session_End event Global.asax.
  • Session ID will be disposed, a new one will be assigned.
  • Will remove all keys and objects in stored in the session.

1 thought on “Differences Between Session.Clear and Session.Abandon?”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s