PC Review


Reply
Thread Tools Rate Thread

Asp.Net and Session - some Interesting Facts

 
 
vikram.lakhotia@gmail.com
Guest
Posts: n/a
 
      30th Sep 2007
Hi,
Yesterday I was discussion with my colleagues about session and a few
interesting things popped up. So I thought I would share the same with
all.

<a href=http://www.vikramlakhotia.com/
A_few_interesting_things_about_session_in_AspNet.aspx>
http://www.vikramlakhotia.com/A_few_interesting_things_about_session_in_AspNet.aspx</a>

Vikram
<A href=http://www.vikramlakhotia.com> http://www.vikramlakhotia.com</a>
<A href=http://JustLikeThat.vikramlakhotia.com>http://
JustLikeThat.vikramlakhotia.com</a>
<A href=http://WhyNot.vikramlakhotia.com>http://
WhyNot.vikramlakhotia.com</a>

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      30th Sep 2007
(E-Mail Removed) wrote:
> Hi,
> Yesterday I was discussion with my colleagues about session and a few
> interesting things popped up. So I thought I would share the same with
> all.
>
> <a href=http://www.vikramlakhotia.com/
> A_few_interesting_things_about_session_in_AspNet.aspx>
> http://www.vikramlakhotia.com/A_few_interesting_things_about_session_in_AspNet.aspx</a>



> Session Class has two methods. Session.Abondon() and Session.Clear().
> Both the methods are used to clear the data in the session. Both the
> methods clear the data in the session.


No, they don't. Session.Clear removes the session variables, but
Session.Abandon doesn't remove anything at all from the session, it only
flags the session object to be abandoned after the request has been handled.

> But there is one difference between them. Session.Abondon() will
> Session_end event will be fired and session_start event will be fired
> on the next request.


Yes, of course. Abandoning the session will end it, and the next request
will start a new session. Clearing the session variables doesn't end the
session.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      1st Oct 2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Session Class has two methods. Session.Abondon() and Session.Clear().


Firstly, it's Abandon, not Abondon...

Secondly, the Session object has eight methods, not two:
http://msdn2.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.abandon(vs.80).aspx

And thirdly (as Göran has pointed out), your distinction between the
Abandon() and Clear() methods is incorrect...

I suggest you remove the blog entry...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fax facts flaming-o Windows Vista General Discussion 2 20th Apr 2008 06:57 AM
Interesting problem with session state...help? Marcus Microsoft ASP .NET 2 25th Mar 2008 10:28 PM
Interesting problem with session state...help? Marcus Microsoft ASP .NET 0 25th Mar 2008 05:39 PM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= Microsoft ASP .NET 4 11th Apr 2007 05:52 PM
Some Interesting Facts You Would Love To Know Stella Windows XP General 2 7th Mar 2007 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 AM.