Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

session_OnEnd dans le global.asa never fired
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



Report this thread to moderator Post Follow-up to this message
Old Post
Olivier SOW
10-27-04 01:55 PM


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



Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Dillon
10-27-04 08:55 PM


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



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
10-27-04 08:55 PM


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



Report this thread to moderator Post Follow-up to this message
Old Post
SOW Olivier
10-28-04 01:55 PM


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:
> 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"



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
10-28-04 01:55 PM


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



Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Dillon
10-28-04 08:55 PM


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



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
10-28-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:48 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.