---
title: "Difference between Session.Abandon() and Clear()?"  
description: "Difference between Session.Abandon() and Clear()?"  
author: "Sushant Mishra"  
published: 2017-06-18  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/23267/difference-between-session-abandon-and-clear  
category: "c#"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Difference between Session.Abandon() and Clear()?

**Session.Abandon():** It destroys the current session by generating a Session_End event. It releases the SessionState object and its items to free the resources.

**Session.Clear( )****:**It just clears the session data (gives a null value to the session) without Destroying it. Session.Clear still holds the SessionState and resources associated with it.

Session ID will remain the same in both of the cases till browser is not closed.

## Answers

### Answer by Sushant Mishra

**Session.Abandon():** It destroys the current session by generating a Session_End event. It releases the SessionState object and its items to free the resources.

**Session.Clear( )****:**It just clears the session data (gives a null value to the session) without Destroying it. Session.Clear still holds the SessionState and resources associated with it.

Session ID will remain the same in both of the cases till browser is not closed.


---

Original Source: https://www.mindstick.com/interview/23267/difference-between-session-abandon-and-clear

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
