|
Home > Archive > IIS ASP > April 2005 > Session_OnEnd major problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Session_OnEnd major problem
|
|
| Propin 2005-04-26, 5:55 pm |
| 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
| |
| Evertjan. 2005-04-26, 5:55 pm |
| 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.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
| |
| Patrice 2005-04-26, 5:55 pm |
| 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...)
--
"Propin" <fredrik.nilsson@malmoaviation.se> a écrit dans le message de
news:%232n7nzmSFHA.1268@TK2MSFTNGP14.phx.gbl...
> 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
>
>
>
>
| |
| Propin 2005-04-26, 5:55 pm |
| 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
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns9644AAAD573ADeejj99@194.109.133.29...
> Propin wrote on 26 apr 2005 in microsoft.public.inetserver.asp.general:
>
>
> 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.
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>
| |
| Propin 2005-04-27, 2:48 am |
| 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?
"Patrice" <nobody@nowhere.com> wrote in message
news:unHMoMnSFHA.3188@TK2MSFTNGP09.phx.gbl...
> 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...)
>
> --
>
> "Propin" <fredrik.nilsson@malmoaviation.se> a écrit dans le message de
> news:%232n7nzmSFHA.1268@TK2MSFTNGP14.phx.gbl...
> Server.CreateObject("Scripting.FilesystemObject")
> Server.CreateObject("Scripting.FilesystemObject")
>
>
|
|
|
|
|