• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 399
  • Last Modified:

Hot to close session in End event of my ASP.NET application ?

 Hi experts!

I’m new to ASP.NET and need a little help.
I have a session variable which I want to delete after my NET application close. I use InPro way and I read that I have events for end of application in which I think I can erase session.

1.      Where in VS2008 I get this event ? How to added it my application?
2.      What are command to complete remove session ? Session.Abandon or Session.Remove or ?
1 Solution
I would suggest you to have the clean up work over the global.asax


dvplayltdAuthor Commented:
ok ...LOOK like this is answe or my question.
But I need some clarify about Session_End .

If user simple close his brouser I will or will not get this event ?

And also you do not answer me on question 2
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

If you want to remove specific session variable then you can use Session.Remove() method and if you want to remove all the session variables then you need to use Session.Abandon() method.

However you still need to understand global.asax file. Please refer below link.


When Session_End() from global.asax executed it clears all the session variables automatically.

Hope this helps.
Alfred A.Commented:
dvplayltdAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now