object in session question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
the garbage collection should do it automatically. If its in the Session
object it will "go away" when the session terminates
 
Hi,

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

regards'
Joyjit
 
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.
 
Back
Top