Application in global.asa??

Discussion in 'ASP General' started by Ray at, Feb 11, 2004.

  1. Ray at

    Ray at Guest

    Why it's decreasing? Because you have that line that is telling the
    application variable to take a new value that is the result of the current
    value with one subtracted from it. Is something not behaving the way you
    expect it to? If so, what?

    Ray at work

    "Vilmar Brazão de Oliveira" <> wrote in message
    news:Ou$...
    > HI,
    > Does Anybody know why the routine bellow is decreasing on session_onend
    > event??


    > Sub Session_OnEnd
    > Application.Lock
    > Application("UsuariosOnline") = Application("UsuariosOnline") - 1
    > Application.UnLock
    > End Sub
    Ray at, Feb 11, 2004
    #1
    1. Advertising

  2. HI,
    Does Anybody know why the routine bellow is decreasing on session_onend
    event??
    In my index.asp i have this statements:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%
    Option Explicit
    Response.Expires = -1
    Response.Buffer = True
    Session.Abandon()
    %>

    MY GLOBAL.ASA:
    <script language="VBScript" runat="Server">

    Sub Application_OnStart
    Application("UsuariosOnline") = 0
    End sub

    Sub Application_OnEnd
    End sub

    Sub Session_OnStart
    Application.Lock
    Session.Timeout = 60 '»»60 min. = 1 h. Tempo de expiração da session padrão
    no site.

    If Application("UsuariosOnline") < 100 then
    Application("UsuariosOnline") = Application("UsuariosOnline") + 1
    Else
    Response.Redirect "409.asp"
    End If

    Application.UnLock
    End sub

    Sub Session_OnEnd
    Application.Lock
    Application("UsuariosOnline") = Application("UsuariosOnline") - 1
    Application.UnLock
    End Sub

    </script>

    THANKS,
    --

    Sem mais,

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC
    Vilmar Brazão de Oliveira, Feb 11, 2004
    #2
    1. Advertising

  3. Aaron Bertrand - MVP, Feb 11, 2004
    #3
  4. hi,
    I have noted that:
    Sub Session_OnEnd
    Application.Lock
    Application("UsuariosOnline") = Application("UsuariosOnline") - 1
    Application.UnLock
    End Sub

    is not making the subtraction when the user close the session!
    the session ends when the user close all the windows of the site, isn't
    right?
    thank you
    --

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu na
    mensagem news:#...
    > Why it's decreasing? Because you have that line that is telling the
    > application variable to take a new value that is the result of the current
    > value with one subtracted from it. Is something not behaving the way you
    > expect it to? If so, what?
    >
    > Ray at work
    >
    > "Vilmar Brazão de Oliveira" <> wrote in message
    > news:Ou$...
    > > HI,
    > > Does Anybody know why the routine bellow is decreasing on session_onend
    > > event??

    >
    > > Sub Session_OnEnd
    > > Application.Lock
    > > Application("UsuariosOnline") = Application("UsuariosOnline") - 1
    > > Application.UnLock
    > > End Sub

    >
    >
    Vilmar Brazão de Oliveira, Feb 11, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darlene Gauthier

    PostRequestHandlerExecute event in global.asa

    Darlene Gauthier, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,410
    Karl Seguin
    Jul 23, 2003
  2. Wayne
    Replies:
    2
    Views:
    456
    Wayne
    Nov 11, 2003
  3. Vince C.
    Replies:
    1
    Views:
    224
    Vince C.
    Apr 3, 2004
  4. CJM
    Replies:
    4
    Views:
    287
    [MSFT]
    Apr 30, 2004
  5. abcd

    application on Start global.asa

    abcd, Oct 6, 2006, in forum: ASP General
    Replies:
    1
    Views:
    93
    Cowboy \(Gregory A. Beamer\)
    Oct 6, 2006
Loading...

Share This Page