If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > global.asa question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-06, 15:19
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
global.asa question

Hi,
first time using global.asa, I am entering a session id in a database when the user logs in, if the user does not use the log out button I need to rely on global.asa to remove the record in the database so here is what I have but it does not work:

Code:
<SCRIPT LANGUAGE="JavaScript" RUNAT="Server">


function Session_OnEnd()
{
var adoConnection = Server.CreateObject("ADODB.Connection");
adoConnection.Open("dsn=xxx;uid=yyyy;pwd=zzzz;");

var removeT = "DELETE FROM tblTrack WHERE sesId = '"+String(Session.SessionID)+"'";
adoConnection.Execute(removeT)



}

</script>
note than it is in ASP JS
Reply With Quote
  #2 (permalink)  
Old 11-09-06, 05:15
KillerApp KillerApp is offline
Registered User
 
Join Date: Jul 2004
Posts: 23
Which bit does not work? Is the function fired?

Question I don't know the answer to: Is OnEnd gaurenteed to be fired -- what about process recycling?
Reply With Quote
  #3 (permalink)  
Old 11-10-06, 05:12
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Hi have tested the content of the function outside the global.asa file and it works, the record is deleted from the database if I trigger the function manually.
So I take the function is not actually triggered, is it OK to use the session ID considering the session just expired, does the ID still exist at the time the function should be triggered?

Many thanks
Reply With Quote
  #4 (permalink)  
Old 11-27-06, 04:22
wash wash is offline
Registered User
 
Join Date: Aug 2004
Location: Pune,India
Posts: 94
I guess global.asa should ideally have code in Vb script(i'm not very sure if it's strictly Vb script).

The Session_OnEnd function has few issues associated with itself. Sometimes it doen't get fired at all. We have faced similar issue but there is no generic solution to this.
__________________
In GOD we believe. Everything else we Test!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On