Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageI 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
>
>
Post Follow-up to this messageI 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.
Post Follow-up to this messageI 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.
|
|
Post Follow-up to this messageNot 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: > 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"
Post Follow-up to this messageI 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" > >
Post Follow-up to this messageNo - 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: > 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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.