General global.asa failure

M

Mikael Hellström

Hi, I have some huge problem. I fell sick for several days because of this
global.asa file problem

This is my problem:
I don't have any problem what so ever home on my local computer. Everything
work like a dream.
But on the webhotell nothing seems to be ok. It seems like session OnEnd
nerver execute..?
I have done the following tests.

1) SUB Application_OnStart will run because Application("namn") give me the
value "test" so will the function
Session_OnStart
2) I have put this code in session OnEnd
response.redirect(http://www.someurl.com) but it wont redirect me
to that url.
3) I have tryed to replace the code strSQL="delete from online where
medlemsNr=" & session("medlemsNr")
to strSQL="delete from online where medlemsNr=100000" dont work!!!

Soo as i can see it Session OnEnd is never called Why??
I'm on a Window IIS account and use a Microsoft sql server 2000

Regards Mikael



======================== My global.asa =====================================


<SCRIPT LANGUAGE=VBScript RUNAT=Server>

SUB Application_OnStart
Application("aktivanu") = 0
Application("namn") = "test"
END SUB

SUB Session_OnStart
Session.Timeout = 10
application.Lock
application("aktivanu") = Application("aktivanu") + 1
application.Unlock
END SUB

SUB Session_OnEnd
application.Lock
application("aktivanu") = Application("aktivanu") - 1
application.Unlock

strCon = connectionStr="Driver={SQL
Server};Server=mssql.webbhotellsgruppen.se;Uid=XXXX;Pwd=XXXXX;Database=XXXXX
XDB;"

Dim objConn ' ADO Recordset Object
Dim objRS ' ADO Connection Object
Dim strSQL

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString=strCon
objConn.Open

strSQL="delete from online where medlemsNr=" & session("medlemsNr")
objConn.Execute strSQL

End sub

</script>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="ChatUsers"
PROGID="Scripting.Dictionary">
</OBJECT>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="conquerChatRooms"
PROGID="Scripting.Dictionary">
</OBJECT>

<OBJECT
RUNAT="Server"
SCOPE="Application"
ID="ChatMessages"
PROGID="Scripting.Dictionary">
</OBJECT>
 
M

Mikael Hellström

Hi all,
Ok i will do like this:
When the people logg on to my site i set the time in a table and
use their member id as key.
Everypage they visit i update this table with a new time.
Fine...Now i nead some help with a stored procedure. I Have never
tryed to write some...
I ned some form of job done can i use a timer so the procedure is called by
the server in
some intervall???

Please can u help me with a code snip or thell me where i can read about
this!
Regards Mikael
 
C

CJM

..sqlserver.programming and/or .asp.db would be good places to ask this
question.

Note: You dont want to delete peoples session data xx minutes after they
have joined your site. You want to remove them xx minutes after their last
action - therefore every page will need to update the db with the time that
the user calls the page:

'Update Sessions Set LastAccessed = GetDate()'

Then your clearup code would then check for sessions that hadnt been used in
xx minutes.

hth

CJM
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top