ASP Session_OnStart() - Session Object Function in the Global.asa file. if client first connect to web server.
ShotDev Focus:
- Session_OnStart()
Example
global.asa
<script language="VBScript" runat="Server"> Sub Application_OnStart Application("OnlineNow") = 0 Application("Msg") = "Welcome to ShotDev.Com" End Sub Sub Session_OnStart Application.Lock Application("OnlineNow") = Application("OnlineNow")+1 Application.UnLock End Sub Sub Session_OnEnd Application.Lock Application("OnlineNow") = Application("OnlineNow")-1 Application.UnLock End Sub </script>
asp_session_onstart.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Response.write Application("OnlineNow") %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_session_onstart.asp
Screenshot
.
.
.