Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Destroying Session Objects

Status
Not open for further replies.

sdidomenico

Programmer
Sep 26, 2003
34
0
0
US
Hello,

I have a question on destroying Session Objects using ASP 3.0. Here I create the Session variable oApp.

Set session ("oApp") =
Server.CreateObject("CrystalRuntime.Application")

Now I want to destroy it.

Is this:
Set session("oApp") = nothing

The same as this:
Session.Contents.Remove("oApp")


The example using the "Set to nothing" was contained in a Crystal Report for ASP example.

If they both work the same, is one way better than the other?

Thanks,

Steve DiDomenico
Nashua, NH
 
Don't use Session.Abandon unless you want to lose ALL your session variables.

Set Session("varname") = nothing is better to use when the session variable is a pointer to an object reference.

Use Session.Contents.Remove("varname") when the variable is not an object.

- Jason

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top