?
Solved

ASP Session.Abandon and Session_OnEnd

Posted on 2002-07-26
6
Medium Priority
?
799 Views
Last Modified: 2007-12-19
Folks,

I have added Session.Abandon to force Session_OnEnd to fire in global.asa, but this is not working.  I have tested the code in IIS4 (NT) and IIS5 (win2k) but all the same.

Can you help please.

Richard.Koudry@bt.com
0
Comment
Question by:koudry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 7179764
Session.Abandon will wpork the NEXT page.

So if you use:
Session.Abandon
response.write session("MYITEM")

The value will still be written. When you do the response.write the next page then it won't be there since the session object is totally empty.

next thing is that the Session.Abandon only takes care of the session variables inside and not of the true session the user is in.

CJ
0
 

Expert Comment

by:Pirado
ID: 7180313
verify the event erros.
0
 

Expert Comment

by:Pirado
ID: 7180316
add a single code to test...
something do not run into global.asa
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7180335
One other issue: don't rely on the Session_OnEnd to work correctly. It is really a hit and miss proposition. If you need certain things to happen, do so through events on your page rather than relying on the global.asa.

Fritz the Blank
0
 
LVL 2

Expert Comment

by:chops123
ID: 7180861
There is a reported Microsoft bug on the Session_OnEnd Event in IIS 4.Im not sure if this has been fixed in IIS 5.

But its better not to script in this event.

Session handling has been a bit of an issue for many people.A session usually expires after 20 min by default.Of course you can always override the session timeout value in your pages or by specifying the session expiry time setting in the IIS.

For example you can store a session variable like session("myTime") = now() and then check something like this to expire after 1 min

If  DateAdd("s", -60, now()) > session("mytime") Then
    session.abandon
    Response.write "<B>session expired</b>"
Else
    Response.write "session exists"
End if

However the drawback to this is that this needs to be checked on each of the pages wherever your session needs to be expired.

Rgds
KC
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 7183835
This question will be placed in PAQ, and points refunded.

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  


But will be in PAQ where is can still be reached, should a working souluton is found, so at the request of the User this will placed in PAQ.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question