Home > Archive > ASP > October 2004 > session_OnEnd dans le global.asa never fired
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 dans le global.asa never fired
|
|
| Olivier SOW 2004-10-27, 8:55 am |
| 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 2004-10-27, 3:55 pm |
| 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...
> 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
>
>
| |
| Bob Barrows [MVP] 2004-10-27, 3:55 pm |
| 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.
| |
| SOW Olivier 2004-10-28, 8:55 am |
| 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] 2004-10-28, 8:55 am |
| 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...
--
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 2004-10-28, 3:55 pm |
| 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...
> 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:
>
> --
> 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"
>
>
| |
| Bob Barrows [MVP] 2004-10-28, 3:55 pm |
| 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=darkred]
> 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...
--
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.
|
|
|
|
|