Classic ASP Application Object

Last updated: August 26, 2026.

The ASP Application object stores values shared by every request in one IIS application. Use it only for small, process-local state—not durable data.

Safely update a shared value

<%
Application.Lock
If IsEmpty(Application("RequestCount")) Then
    Application("RequestCount") = 0
End If
Application("RequestCount") = CLng(Application("RequestCount")) + 1
Dim requestCount
requestCount = Application("RequestCount")
Application.Unlock

Response.Write requestCount
%>

Use Application.Lock and Application.Unlock around related writes. Values disappear when the application restarts and are not shared reliably across multiple servers, so use a database or distributed cache for durable or scaled state.

admin

admin

Leave a Reply

Your email address will not be published.