When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Senior Application DBA - SQL Server
Professional Technical Resources
US-OR-Lake Oswego

Justtechjobs.com Post A Job | Post A Resume

Published: Sunday, June 20, 1999

Using @ENABLESESSIONSTATE


Let me start by saying Session variables are not good. Note that I did not say that they were bad, just not good. Session variables have their Pros & Cons, but the cons can easily outweight the pros, especially if they are used heavily. However, there are times when Session variables are needed.

- continued -

So, let's say that you have a website of 50 ASP pages, and four of these pages use Session variables. No matter what page you load, IIS has to prepare for the chance that that particular page might use Session variables; this preparation is called "Session tracking." According to the IIS Documentation, "Session tracking maintains information about a set of requests that are issued by a single client." This maintenance, of course, comes at a performance cost. Why, though, should this performance hit affect all of your ASP pages, even the ones that don't use Session variables?

It doesn't have to. You can explicitly tell IIS that you aren't using any Session variables for a particular ASP page. All you need to do is add this single line of code at the top of your ASP page:

<%@ ENABLESESSIONSTATE=False %>

By adding this line of code, you are informing IIS that it need not worry about Session tracking for the ASP page. I hope this has been educational and helpful!

Happy Programming!


Related Articles:

  • Pros & Cons of Session Variables


    Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article



  • JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers