← Back to Session, State, and Security
Lesson 2

Application State

Session, State, and Security · Created 2026-06-01 13:34:28

Application variables are shared across ALL users.

Usage
Application.Lock
Application('counter') = Application('counter') + 1
Application.Unlock

Always lock before writing and unlock after.

Global.asa Events
Sub Application_OnStart() - runs once at first request
Sub Session_OnStart() - runs per new session
Sub Application_OnEnd() - runs when app stops
Sub Session_OnEnd() - runs on session expiry

ASPPY Note
OnStart fires before the first Session_OnStart. Missing subs are skipped.

Live Demo →