Session close event

Added by Mahmudul Hasan 27 days ago

I am surprised/puzzled with the session destruction process of wt. I was expecting that the destruction will be immediate. But it takes 10 min exactly to execute the destructor.

Can anyone explain me how wt manages it? Can it be faster - like immediately?

Client1::~Client1() {
Server::Instance().Disconnect(this);
Clean();
Wt::WApplication::instance()->enableUpdates(false);
}


Replies (5)

RE: Session close event - Added by lm at 26 days ago

When are you thinking the session should be destroyed? After every request?

RE: Session close event - Added by Mahmudul Hasan 26 days ago

- Session is destroyed if user has no interaction for 10 min. It's fine.
- But if user closes the page/tab it should close immediately.

RE: Session close event - Added by Wim Dumon 24 days ago

Hello Mahmudul,

Wt tries to send a signal to the server when a page is left or a tab is closed, but browsers don't guarantee that this signal is effectively generated or that you will still be able to do anything (such as contact the server) when this signal is generated. Therefore, Wt has a secondary mechanism with pings, that will destroy the session if there are no pings within a configurable time-out. That's the 10 minute delay you see.

RE: Session close event - Added by Mahmudul Hasan 24 days ago

Can the time be configured to some other interval less than 10 min? Cause 10 minute is too much delay for us!

RE: Session close event - Added by Wim Dumon 24 days ago

Yes, in wt_config.xml.

Wim.

(1-5/5)