Two articles on releasing the session (i)

Source: Internet
Author: User
Session If you are using ASP 3.0 (the version of ASP-comes with Windows 2000/iis 5) then your can use the following Syntax

Session.Contents.Remove "Name"

Where name is the name of the session variable your wish to remove. Removing session variables in this way has its advantages by using the following method:

Session ("Name") = Null

Namely, the above method (setting a sessions variable to Null) is only removes the memory associated and the session variable itself. The Session object still maintains a reference to it, though. The session object with a Key/item pair, similar to the Scripting.Dictionary object. Therefore, using the Null method above, you are not removing the key from the session Contents collection that contains th E reference to the variable ...

With the ' Remove method ' We looked at the are removing both the key and item associated. There is also a removeall-can is used to scrap all of the sessions variables completely:

Session.Contents.RemoveAll

Again, the Remove and RemoveAll methods are new to ASP 3.0. If you are have ASP 2.0, you'll need to use the Null method



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.