| View previous topic :: View next topic |
| Author |
Message |
Shane Holmes Guest
|
Posted: Tue May 01, 2007 6:41 am Post subject: Session Count ? |
|
|
I am creating a IW ISAPI DLL (Delphi 2007 & IW 9.X)
When is a session actually destroyed?
I am trying to keep track of the session count.
Example:
TIWServerController = class(TIWServerControllerBase)
procedure IWServerControllerBaseNewSession(ASession: TIWApplication var
VMainForm: TIWBaseForm);
procedure IWServerControllerBaseCreate(Sender: TObject);
procedure IWServerControllerBaseCloseSession(ASession: TIWApplication);
private
public
Sessions: Integer;
end;
procedure TIWServerController.IWServerControllerBaseCreate(
Sender: TObject);
begin
//
Sessions:= 0;
end;
procedure TIWServerController.IWServerControllerBaseCloseSession(
ASession: TIWApplication);
begin
//
Sessions:= Sessions - 1;
end;
procedure TIWServerController.IWServerControllerBaseNewSession(
ASession: TIWApplication; var VMainForm: TIWBaseForm);
begin
ASession.Data := TIWUserSession.Create(nil);
Sessions:= Sessions + 1;
end;
When creating new sessions, the count works fine
How do I get the count to decrease. When I close the web browser of one, the
count never goes down (yes, I do update the label showing the count) through
a form render
thanks |
|
| Back to top |
|
 |
Farshad Guest
|
Posted: Tue May 01, 2007 8:12 am Post subject: Re: Session Count ? |
|
|
A session is destroyed when a timeout occurs. SessionTimeout variable is 10
minutes by default. It means if you leave your WebApp idle for 10 minutes
then the created session is automatically destroyed. The other way to
terminate a session is doing it by explicitly calling
WebApplication.Terminate method. You can add an Exit item to your menu so
user can exit when his task is finished.
Closing a browser will not cause the Application to terminate because no
information is sent back when you close the browser. That's why IW uses
timeout method. One disadvantage of this method is that if user is idle for
more than 10 minutes he can't continue using the application after a timeout
occurs. He will need to restart a new session. To avoid this you can add
IWTimer component to your forms. It forces your pages to refresf say each 5
minutes so a timeout condition is avoided as long as the browser window is
left open. However if your webapp has many forms you must add an IWTimer to
each form which is not practical.
"Shane Holmes"
| Quote: | I am creating a IW ISAPI DLL (Delphi 2007 & IW 9.X)
When is a session actually destroyed?
I am trying to keep track of the session count.
|
|
|
| Back to top |
|
 |
Shane Holmes Guest
|
Posted: Tue May 01, 2007 5:23 pm Post subject: Re: Session Count ? |
|
|
THANK YOU!
"Farshad" <farshad (AT) fmsoft (DOT) net> wrote in message
news:4636e56f (AT) newsgroups (DOT) borland.com...
| Quote: | A session is destroyed when a timeout occurs. SessionTimeout variable is 10
minutes by default. It means if you leave your WebApp idle for 10 minutes
then the created session is automatically destroyed. The other way to
terminate a session is doing it by explicitly calling
WebApplication.Terminate method. You can add an Exit item to your menu so
user can exit when his task is finished.
Closing a browser will not cause the Application to terminate because no
information is sent back when you close the browser. That's why IW uses
timeout method. One disadvantage of this method is that if user is idle
for more than 10 minutes he can't continue using the application after a
timeout occurs. He will need to restart a new session. To avoid this you
can add IWTimer component to your forms. It forces your pages to refresf
say each 5 minutes so a timeout condition is avoided as long as the
browser window is left open. However if your webapp has many forms you
must add an IWTimer to each form which is not practical.
"Shane Holmes"
I am creating a IW ISAPI DLL (Delphi 2007 & IW 9.X)
When is a session actually destroyed?
I am trying to keep track of the session count.
|
|
|
| Back to top |
|
 |
|