Global.asa

O

Osama Yahya

Hello there:
My Golbal.asa file isn't firing or working, I put it in the rootdirectory whereall my asp files, my web diectory is set asapplication, I looked throught the internet for similar problembut I am still unable to get it to work. I tried to showapplication variable in asp file by using response.WriteApplication("start") and nothing is showing on the browser.
I am running IIS on windows 2000
Any help is much appreciated. Here is my golbal.asa file:

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">' I do this becauseyou can't use Server.MapPath
' in Session_OnEnd... you'll have to modify this
' to reflect the appropriate path on your server.
Const strLogFilePath = "C:\MyFolderName\session.log"
Sub Application_OnStart
Application("Start") = Now()
End Sub
Sub Session_OnStart
Session.Timeout = 5
Session("Start") = Now()
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " started at" & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " ended at "& Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
</SCRIPT>
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

Restart the application in IIS and then check the variable. Changing the
global.asa file will show up in new Sessions, but code in
Application_OnStart requires the service actually stop and start.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Hello there:
My Golbal.asa file isn't firing or working, I put it in the root directory
whereall my asp files, my web diectory is set as application, I looked
throught the internet for similar problem but I am still unable to get it to
work. I tried to show application variable in asp file by using
response.Write Application("start") and nothing is showing on the browser.
I am running IIS on windows 2000
Any help is much appreciated. Here is my golbal.asa file:

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">' I do this because you can't use
Server.MapPath
' in Session_OnEnd... you'll have to modify this
' to reflect the appropriate path on your server.
Const strLogFilePath = "C:\MyFolderName\session.log"
Sub Application_OnStart
Application("Start") = Now()
End Sub
Sub Session_OnStart
Session.Timeout = 5
Session("Start") = Now()
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " started at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " ended at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top