Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WebSnap onEndSession not firing.

0 views
Skip to first unread message

Derek_Smallbouys

unread,
Jan 30, 2007, 9:14:50 AM1/30/07
to
Hello,

I have a standalone application that logsin to a websnap based
website, once my application has done what it needs to do, I call
session.Terminate on the applications session. The only problem is
that the onEndSession event is not firing until a subsequent action
occurs on the site from another user. Once onEndSession occurs it
affects the session that made that next action and not my application
session.

>From what I have seen this is a problem of long standing, but I was
wondering if anybody out there is aware or can offer pointers, or ways
around which they managed to solve the problem.

THanks

Bob Swart

unread,
Jan 30, 2007, 10:23:41 AM1/30/07
to
Hi Derek,

> I have a standalone application that logsin to a websnap based
> website, once my application has done what it needs to do, I call
> session.Terminate on the applications session. The only problem is
> that the onEndSession event is not firing

I noticed that myself a few years ago, and wrote about it (as a small
note) in my WebSnap CGI Login article for The Delphi Magazine, available
as free sample article at
http://www.thedelphimagazine.com/samples/1391/1391.htm

> From what I have seen this is a problem of long standing, but I was
> wondering if anybody out there is aware or can offer pointers, or ways
> around which they managed to solve the problem.

Indeed: the OnEndSession event handler is not called automatically when
a WebSnap CGI web server application is unloaded. To enforce this, I had
to write one more line of code in the OnDeactivate event handler of the
WebAppPageModule (note that it won’t work if you put it in the OnDestroy
event handler).

procedure THome.WebAppPageModuleDeactivate(Sender: TObject);
begin
SessionsService.OnEndSession(Self, Session, esTimeOut);
end;

This will ensure that the SessionsSevice.OnEndSession event handler is
called when the web module is deactivated.

A similar trick may work for you as well.

Groetjes,
Bob Swart

--
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
New Delphi 2006 Courseware e-books at http://www.eBob42.com/courseware

0 new messages