Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP Session_OnStart and Session_OnEnd Events

ASP Session_OnStart and Session_OnEnd Events


Session Object Reference Complete Session object reference manual


The Session_OnStart event

The Session_OnStart event occurs when the server creates a new session.

This event is placed in the Global.asa file.

The Session_OnEnd event

The Session_OnEnd event occurs when a session ends (when it is abandoned or times out).

This event is placed in the Global.asa file.

**Note:** The MapPath method cannot be used in Session_OnEnd code.

Syntax


Example

Global.asa:

Displaying the current number of visitors in an ASP file:

There are <%response.write(Application("visitors"))%>

online now!


Session Object Reference Complete Session object reference manual