Session_OnEnd major problem

P

Propin

Have a problem with below code in global.asa. Same problem as described in
this news group before, IWAM_machinename did not solve my problem.
Have created the following test code (file is never deleted on my IIS6
Win2003
environment, any idea?):

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart

End Sub

Sub Session_OnStart

Set objFileSystemObject = Server.CreateObject("Scripting.FilesystemObject")

objFileSystemObject.CreateTextFile "C:\temp\error\Test.txt", True

Set objFileSystemObject = Nothing

End Sub

Sub Session_OnEnd

Set objFileSystemObject = Server.CreateObject("Scripting.FilesystemObject")

objFileSystemObject.CreateTextFile "C:\temp\error\Test.txt", True

Set objFileSystemObject = Nothing

End Sub

Sub Application_OnEnd

End Sub

</SCRIPT>

/Propin
 
E

Evertjan.

Propin wrote on 26 apr 2005 in microsoft.public.inetserver.asp.general:
Have a problem with below code in global.asa. Same problem as
described in this news group before, IWAM_machinename did not solve my
problem. Have created the following test code (file is never deleted
on my IIS6 Win2003
environment, any idea?):

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart

End Sub

Sub Session_OnStart

Set objFileSystemObject =
Server.CreateObject("Scripting.FilesystemObject")

objFileSystemObject.CreateTextFile "C:\temp\error\Test.txt", True

Set objFileSystemObject = Nothing

End Sub

Sub Session_OnEnd

Set objFileSystemObject =
Server.CreateObject("Scripting.FilesystemObject")

objFileSystemObject.CreateTextFile "C:\temp\error\Test.txt", True

Set objFileSystemObject = Nothing

End Sub

Sub Application_OnEnd

End Sub

</SCRIPT>

Elementary, my dear Propin:
There is no code to delete any file in the above whatever,
only multiple creation of the same.

True?

===============

More seriously and as said so many times in this NG:
Leave Session_OnEnd alone.
 
P

Patrice

Deleted or overwritten ?
When do you expect it will happen ?
Any specific error ?
Perhaps http://support.microsoft.com/kb/277329/en-us

Overall what would you like to do ? My personal preference is to avoid
Session_OnEnd (could not fire in case of problem, not the same security
context, out of the "normal" execution flow etc...)
 
P

Propin

Ofcourse, in the session_OnEnd createfile should be replaced by DeleteFile.
My misstake when copying the code. The file is never deleted, sometimes the
event pops upp in event viewer (but not all the time..):

"Failed to impersonate the Anonymous User for ASP Application
/LM/W3SVC/1/ROOT. Global.ASA OnEnd routines will not be executed."

To test different users all of these are configured on the folder:

Locla Administrators

ASPNET

IWAM_xxxxxxxx

Network

Network Service

System

Local Users

/Propin
 
P

Propin

This does not apply to IIS6 on Win2003, it is also only a problem when I
need to connect to network recources. I have this problem on local disc
access.....Other ideas?
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top