Session _OnEnd problems

Results 1 to 2 of 2

Thread: Session _OnEnd problems

  1. #1
    Branton Boehm Guest

    Default Session _OnEnd problems

    I asked this question in the normal "ASP Q&A" section, but haven&#039;t seemed to get any help that fixes my problem. So I thought I&#039;d try it here.<BR><BR>Basically, my Session_OnEnd function in my global.asa file isn&#039;t being called when sessions timeout. Here is my code:<BR><BR>&#060;SCRIPT LANGUAGE=JScript RUNAT=Server&#062;<BR>function Session_OnStart() {<BR>**Application.Lock();<BR>****var temp = Application("ActiveUsers");<BR>****temp++;<BR> ****Application("ActiveUsers") = temp;<BR>**Application.UnLock();<BR><BR>**Sess ion.Timeout = 1;<BR>}<BR><BR>function Session_OnEnd() {<BR>**Application.Lock();<BR>****var temp = Application("ActiveUsers");<BR>****temp--;<BR>****Application("ActiveUsers") = temp;<BR>**Application.UnLock();<BR>}<BR><BR>fun ction Application_OnStart() {<BR>**Application("ActiveUsers") = 0;<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>The ActiveUsers count increments properly, but never decrements. In debugging, I put some code in to write to a log file when each function was called, and Session_OnEnd was never executed, like I expected.<BR><BR>Is this a normal problem with ASP? Does anyone know how to fix this? I&#039;d appreciate it a lot!

  2. #2
    Join Date
    Dec 1969

    Default Session _OnEnd not reliable

    you can&#039;t rely on it at all. sometimes it just doesn&#039;t fire.<BR><BR>plus your JScript code isn&#039;t quite right. for that event syntax you&#039;d be better off just using VBScript. in JScript you need to use as slightly different structure. I don&#039;t have the code right here at the moment though.<BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts