Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > object in session question

Reply
Thread Tools

object in session question

 
 
=?Utf-8?B?Sko=?=
Guest
Posts: n/a
 
      01-13-2005
Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in the
session and creating a new one. Any ideas on how to do this? What's the best
method to do this?

Thanks,

JJ
 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      01-13-2005
the garbage collection should do it automatically. If its in the Session
object it will "go away" when the session terminates

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"JJ" <> wrote in message
news:892318A5-8814-4EC7-B38A-...
> Hi,
>
> I assigned a class to a session and after its use during the session I
> want to null it out of the session or reset it by killing the object in
> the
> session and creating a new one. Any ideas on how to do this? What's the
> best
> method to do this?
>
> Thanks,
>
> JJ



 
Reply With Quote
 
 
 
 
Joyjit Mukherjee
Guest
Posts: n/a
 
      01-13-2005
Hi,

Call the Remove method of the HttpSessionState class to remove the item from
Session, and then dispose it.

regards'
Joyjit

"JJ" <> wrote in message
news:892318A5-8814-4EC7-B38A-...
> Hi,
>
> I assigned a class to a session and after its use during the session I
> want to null it out of the session or reset it by killing the object in

the
> session and creating a new one. Any ideas on how to do this? What's the

best
> method to do this?
>
> Thanks,
>
> JJ



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      01-13-2005
Okay, you want to "start a new one," which means you want to replace the
current instance with another instance, correct? If so, just assign the new
instance to the Session variable. Once this is done, the old instance has no
references, and Garbage Collection will clean it up.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"JJ" <> wrote in message
news:892318A5-8814-4EC7-B38A-...
> Hi,
>
> I assigned a class to a session and after its use during the session I
> want to null it out of the session or reset it by killing the object in
> the
> session and creating a new one. Any ideas on how to do this? What's the
> best
> method to do this?
>
> Thanks,
>
> JJ



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Stored Session object is mixed up with another user's session object. momo898 ASP .Net 2 10-12-2006 03:33 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57