Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Application in global.asa??

Reply
Thread Tools

Application in global.asa??

 
 
Ray at
Guest
Posts: n/a
 
      02-11-2004
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" <(E-Mail Removed)> wrote in message
news:Ou$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      02-11-2004
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


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      02-11-2004
> the session ends when the user close all the windows of the site, isn't
> right?


Not usually.

http://www.aspfaq.com/2078
http://www.aspfaq.com/2265
http://www.aspfaq.com/2491

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


 
Reply With Quote
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      02-11-2004
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:#(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:Ou$(E-Mail Removed)...
> > 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

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Winform Application Configuration Deleted by Application lhak ASP .Net 0 10-23-2004 11:47 PM
Calling Windows application from Web application ASP .Net 1 11-02-2003 03:30 AM
What issue will HIT me hard when I convert an Access 2002 MDE application to Web Application? Sean ASP .Net 2 08-07-2003 07:13 AM
Application folder not seeing namespace of the main application gh0st54 ASP .Net 0 07-04-2003 07:15 PM
How to inherit a base form in all application forms of an asp.net application varun varun ASP .Net 0 07-03-2003 08:58 AM



Advertisments