Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Asp.Net and Session - some Interesting Facts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vikram.lakhotia@gmail.com - 30 Sep 2007 22:23 GMT
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.a
spx</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>
Göran Andersson - 30 Sep 2007 22:40 GMT
> Hi,
> Yesterday I was discussion with my colleagues about session and a few
[quoted text clipped - 4 lines]
> A_few_interesting_things_about_session_in_AspNet.aspx>
> http://www.vikramlakhotia.com/A_few_interesting_things_about_session_in_AspNet.a
spx</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.

Signature

Göran Andersson
_____
http://www.guffa.com

Mark Rae [MVP] - 01 Oct 2007 00:00 GMT
> 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.httpsessionstat
e.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...

Signature

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


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.