Loading ...

Difference between Session.Clear and Session.End

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  getting started / general asp.net   » Difference between Session.Clear and Session.End

Difference between Session.Clear and Session.End

Posts under the topic: Difference between Session.Clear and Session.End

Posted: 9/29/2010

Lurker 100  points  Lurker
  • Joined on: 9/11/2010
  • Posts: 20

Hi,

I just noticed that there are two methods Session.Clear and Session.End. Can you please tell me the difference between them ?


Posted: 9/29/2010

Guru 16813  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490
  Answered

Session.Clear -It will clear the data present in session , session will still remain alive.

Session.Abandon - Cancels the session


Posted: 9/29/2010

Professional 8338  points  Professional
  • Joined on: 4/15/2009
  • Posts: 424
  Answered

peter-smith said:

user="peter smith"]I just noticed that there are two methods Session.Clear and Session.End. Can you please tell me the difference between them ?

Perhaps you are referring to the difference between Session.Clear() and Session.Abandon(). As already stated by Raghav Session.Clear() will simply clears out the data in Session but it doesn't mean the Session will be killed. Session_End is an event in which it fires when:

  • Session state is set to InProc mode
  • Session times out
  • Session.Abandon is explicitly called

Page 1 of 1 (3 items)