Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Global.asa

Status
Not open for further replies.

ter79

IS-IT--Management
Jul 11, 2001
106
US
I have the following code in global.asa file

Sub Session_OnEnd
Response.Redirect "../includes/logoff.asp"
End sub

but I keep getting the following error when the session timeout is reached.

Microsoft VBScript runtime error: Object required: 'Response'

What am I missing or doing wrong?? Thanks in advance
 
I don't believe that you can use the response object in the global.asa folder - sorry.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
I think mwolf00 is correct.

If you are trying to do this redirect in order to update your database with the user logoff then I believe you can do that in global.asa instead.

Tony
________________________________________________________________________________
 
I'm using the global.asa file not folder. Mu understanding is that you can use that file to handle the following events:

Session_OnStart
Session_OnEnd
Application_OnStart
Application_OnEnd

 
You are correct - I think mwolf00 just typed folder by mistake though.

global.asa does not have any interaction with the client machine at all. All the code within it can do is to interact with the Server.

Are you trying to update the database by telling it that a particular user has now logged off?

Tony
________________________________________________________________________________
 
I'm trying to setup a session timeout that will redirect to the page in question
 
ter79 - one way to do this is actually to have a javascript that runs on each page. When your session is about to expire (after 20 mins of inactivity for instance) you have the javascript do the redirect (say at 19 mins and 50 secs). The page you redirect to can use the session.abandon() to kill the session also!

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
To clarify, it requires Javascript to have the browser "wake up" and suddenly request the logout page.

As the folks above pointed out, the events in global.asa aren't related to any particular browser/client and so there is no request object and there is no response object. The session object is available in Session End, though, so for example if you were using SQL Server transactions over multiple asp pages, you could automatically rollback the transaction if one is still active on Session End (which you'd know by storing the ID and status in each user's session object).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top