Connecting Tech Pros Worldwide Forums | Help | Site Map

session_OnEnd dans le global.asa never fired

Olivier SOW
Guest
 
Posts: n/a
#1: Jul 21 '05
Hi,

I have this code in the global.asa file:


Sub Session_OnEnd()
Set oFso= CreateObject("Scripting.FileSystemObject")
Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
Set oFso= nothing: Set oFileTxt= nothing
End Sub

Sub Session_OnStart()
Set oFso= CreateObject("Scripting.FileSystemObject")
Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
Set oFso= Nothing: Set oFileTxt= Nothing
End Sub


when i start un new session, i have new entries in the file c:\debugS.txt
but nothing on session End.
I know that i must wait the session's end (and not user leaves).
When i force session End with session.abandon() function, i have a new
session added in the debugS.txt file but no session end entry ?!?

what happen ?
somebody can help me ?

thanx a lot



Jeff Dillon
Guest
 
Posts: n/a
#2: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


I would recommend never using session_onend. It is unreliable at best, as
you are discovering.

Jeff

"Olivier SOW" <osow@espace-competences.org> wrote in message
news:OHdjEkAvEHA.1308@TK2MSFTNGP09.phx.gbl...[color=blue]
> Hi,
>
> I have this code in the global.asa file:
>
>
> Sub Session_OnEnd()
> Set oFso= CreateObject("Scripting.FileSystemObject")
> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
> Set oFso= nothing: Set oFileTxt= nothing
> End Sub
>
> Sub Session_OnStart()
> Set oFso= CreateObject("Scripting.FileSystemObject")
> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
> Set oFso= Nothing: Set oFileTxt= Nothing
> End Sub
>
>
> when i start un new session, i have new entries in the file c:\debugS.txt
> but nothing on session End.
> I know that i must wait the session's end (and not user leaves).
> When i force session End with session.abandon() function, i have a new
> session added in the debugS.txt file but no session end entry ?!?
>
> what happen ?
> somebody can help me ?
>
> thanx a lot
>
>[/color]


Bob Barrows [MVP]
Guest
 
Posts: n/a
#3: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


I suspect a permissions issue. In Session_onend, it's the IWAM account that
the code runs as, not the IUSR
Olivier SOW wrote:[color=blue]
> Hi,
>
> I have this code in the global.asa file:
>
>
> Sub Session_OnEnd()
> Set oFso= CreateObject("Scripting.FileSystemObject")
> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
> Set oFso= nothing: Set oFileTxt= nothing
> End Sub
>
> Sub Session_OnStart()
> Set oFso= CreateObject("Scripting.FileSystemObject")
> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
> Set oFso= Nothing: Set oFileTxt= Nothing
> End Sub
>
>
> when i start un new session, i have new entries in the file
> c:\debugS.txt but nothing on session End.
> I know that i must wait the session's end (and not user leaves).
> When i force session End with session.abandon() function, i have a new
> session added in the debugS.txt file but no session end entry ?!?
>
> what happen ?
> somebody can help me ?
>
> thanx a lot[/color]

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


SOW Olivier
Guest
 
Posts: n/a
#4: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


I know that.
By default IWAM user don't have write access to c:\ ???


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> a écrit dans le message de
news:%23svCusEvEHA.3416@TK2MSFTNGP09.phx.gbl...
| I suspect a permissions issue. In Session_onend, it's the IWAM account
that
| the code runs as, not the IUSR
| Olivier SOW wrote:
| > Hi,
| >
| > I have this code in the global.asa file:
| >
| >
| > Sub Session_OnEnd()
| > Set oFso= CreateObject("Scripting.FileSystemObject")
| > Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
| > oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
| > Set oFso= nothing: Set oFileTxt= nothing
| > End Sub
| >
| > Sub Session_OnStart()
| > Set oFso= CreateObject("Scripting.FileSystemObject")
| > Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
| > oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
| > Set oFso= Nothing: Set oFileTxt= Nothing
| > End Sub
| >
| >
| > when i start un new session, i have new entries in the file
| > c:\debugS.txt but nothing on session End.
| > I know that i must wait the session's end (and not user leaves).
| > When i force session End with session.abandon() function, i have a new
| > session added in the debugS.txt file but no session end entry ?!?
| >
| > what happen ?
| > somebody can help me ?
| >
| > thanx a lot
|
| --
| Microsoft MVP -- ASP/ASP.NET
| Please reply to the newsgroup. The email account listed in my From
| header is my spam trap, so I don't check it very often. You will get a
| quicker response by posting to the newsgroup.
|
|


Bob Barrows [MVP]
Guest
 
Posts: n/a
#5: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


Not on my machine. Take a look at the file system settings on yours.

Bob Barrows

PS. You should not be granting that user account permissions for you whole c
drive: that's a huge security hole. Permissions shold be granted on an
as-needed basis.

SOW Olivier wrote:[color=blue]
> I know that.
> By default IWAM user don't have write access to c:\ ???
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> a écrit dans le
> message de news:%23svCusEvEHA.3416@TK2MSFTNGP09.phx.gbl...[color=green]
>> I suspect a permissions issue. In Session_onend, it's the IWAM
>> account that the code runs as, not the IUSR
>> Olivier SOW wrote:[color=darkred]
>>> Hi,
>>>
>>> I have this code in the global.asa file:
>>>
>>>
>>> Sub Session_OnEnd()
>>> Set oFso= CreateObject("Scripting.FileSystemObject")
>>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
>>> oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
>>> Set oFso= nothing: Set oFileTxt= nothing
>>> End Sub
>>>
>>> Sub Session_OnStart()
>>> Set oFso= CreateObject("Scripting.FileSystemObject")
>>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
>>> oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
>>> Set oFso= Nothing: Set oFileTxt= Nothing
>>> End Sub
>>>
>>>
>>> when i start un new session, i have new entries in the file
>>> c:\debugS.txt but nothing on session End.
>>> I know that i must wait the session's end (and not user leaves).
>>> When i force session End with session.abandon() function, i have a
>>> new session added in the debugS.txt file but no session end entry
>>> ?!?
>>>
>>> what happen ?
>>> somebody can help me ?
>>>
>>> thanx a lot[/color]
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.[/color][/color]

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jeff Dillon
Guest
 
Posts: n/a
#6: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


I think you are assuming the session on_end fires at all.

Try something besides writing to a text file to convince yourself this code
is being hit at all..

Jeff
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:O$j6uwNvEHA.2012@TK2MSFTNGP15.phx.gbl...[color=blue]
> Not on my machine. Take a look at the file system settings on yours.
>
> Bob Barrows
>
> PS. You should not be granting that user account permissions for you whole[/color]
c[color=blue]
> drive: that's a huge security hole. Permissions shold be granted on an
> as-needed basis.
>
> SOW Olivier wrote:[color=green]
> > I know that.
> > By default IWAM user don't have write access to c:\ ???
> >
> >
> > "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> a écrit dans le
> > message de news:%23svCusEvEHA.3416@TK2MSFTNGP09.phx.gbl...[color=darkred]
> >> I suspect a permissions issue. In Session_onend, it's the IWAM
> >> account that the code runs as, not the IUSR
> >> Olivier SOW wrote:
> >>> Hi,
> >>>
> >>> I have this code in the global.asa file:
> >>>
> >>>
> >>> Sub Session_OnEnd()
> >>> Set oFso= CreateObject("Scripting.FileSystemObject")
> >>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> >>> oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
> >>> Set oFso= nothing: Set oFileTxt= nothing
> >>> End Sub
> >>>
> >>> Sub Session_OnStart()
> >>> Set oFso= CreateObject("Scripting.FileSystemObject")
> >>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
> >>> oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
> >>> Set oFso= Nothing: Set oFileTxt= Nothing
> >>> End Sub
> >>>
> >>>
> >>> when i start un new session, i have new entries in the file
> >>> c:\debugS.txt but nothing on session End.
> >>> I know that i must wait the session's end (and not user leaves).
> >>> When i force session End with session.abandon() function, i have a
> >>> new session added in the debugS.txt file but no session end entry
> >>> ?!?
> >>>
> >>> what happen ?
> >>> somebody can help me ?
> >>>
> >>> thanx a lot
> >>
> >> --
> >> Microsoft MVP -- ASP/ASP.NET
> >> Please reply to the newsgroup. The email account listed in my From
> >> header is my spam trap, so I don't check it very often. You will get
> >> a quicker response by posting to the newsgroup.[/color][/color]
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>[/color]


Bob Barrows [MVP]
Guest
 
Posts: n/a
#7: Jul 21 '05

re: session_OnEnd dans le global.asa never fired


No - it fires. When there's a filesystem access problem, I do get an error
message ... oh! You weren't talking to me :-)

Bob

Jeff Dillon wrote:[color=blue]
> I think you are assuming the session on_end fires at all.
>
> Try something besides writing to a text file to convince yourself
> this code is being hit at all..
>
> Jeff
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:O$j6uwNvEHA.2012@TK2MSFTNGP15.phx.gbl...[color=green]
>> Not on my machine. Take a look at the file system settings on yours.
>>
>> Bob Barrows
>>
>> PS. You should not be granting that user account permissions for you
>> whole c drive: that's a huge security hole. Permissions shold be
>> granted on an as-needed basis.
>>
>> SOW Olivier wrote:[color=darkred]
>>> I know that.
>>> By default IWAM user don't have write access to c:\ ???
>>>
>>>
>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> a écrit dans le
>>> message de news:%23svCusEvEHA.3416@TK2MSFTNGP09.phx.gbl...
>>>> I suspect a permissions issue. In Session_onend, it's the IWAM
>>>> account that the code runs as, not the IUSR
>>>> Olivier SOW wrote:
>>>>> Hi,
>>>>>
>>>>> I have this code in the global.asa file:
>>>>>
>>>>>
>>>>> Sub Session_OnEnd()
>>>>> Set oFso= CreateObject("Scripting.FileSystemObject")
>>>>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
>>>>> oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
>>>>> Set oFso= nothing: Set oFileTxt= nothing
>>>>> End Sub
>>>>>
>>>>> Sub Session_OnStart()
>>>>> Set oFso= CreateObject("Scripting.FileSystemObject")
>>>>> Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
>>>>> oFileTxt.WriteLine Now()&" SESSION START "&session.sessionId
>>>>> Set oFso= Nothing: Set oFileTxt= Nothing
>>>>> End Sub
>>>>>
>>>>>
>>>>> when i start un new session, i have new entries in the file
>>>>> c:\debugS.txt but nothing on session End.
>>>>> I know that i must wait the session's end (and not user leaves).
>>>>> When i force session End with session.abandon() function, i have a
>>>>> new session added in the debugS.txt file but no session end entry
>>>>> ?!?
>>>>>
>>>>> what happen ?
>>>>> somebody can help me ?
>>>>>
>>>>> thanx a lot
>>>>
>>>> --
>>>> Microsoft MVP -- ASP/ASP.NET
>>>> Please reply to the newsgroup. The email account listed in my From
>>>> header is my spam trap, so I don't check it very often. You will
>>>> get a quicker response by posting to the newsgroup.[/color]
>>
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so
>> I don't check it very often. If you must reply off-line, then remove
>> the "NO SPAM"[/color][/color]

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Closed Thread