session_OnEnd dans le global.asa never fired

O

Olivier SOW

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
 
J

Jeff Dillon

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

Jeff
 
B

Bob Barrows [MVP]

I suspect a permissions issue. In Session_onend, it's the IWAM account that
the code runs as, not the IUSR
 
S

SOW Olivier

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


"Bob Barrows [MVP]" <[email protected]> a écrit dans le message de
| 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.
|
|
 
B

Bob Barrows [MVP]

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.
 
J

Jeff Dillon

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
 
B

Bob Barrows [MVP]

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

Bob
 

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

Similar Threads

Global.asa 5
Global.asa 2
Global.asa and Session_OnEnd 1
global.asa @ Session_OnEnd 1
Session_OnEnd method not firing 1
Session_OnEnd major problem 4
Global.asa - Session_OnEnd Question .. 6
Global.asa 0

Members online

No members online now.

Forum statistics

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

Latest Threads

Top