Does session timeout close session?

When a session timeout occurs (due to a connection being idle for set period of time) does the session close event get fired when the timeout occurs?

If you’re talking about Session.TimeOut, you need to implement the Session.TimedOut event and close the session yourself.

Ah ok, sorry but I have checked the docs and I cannot see how you “close the session yourself”, do you mean do the stuff you need to do to close the session and that after the timeout event finishes the session is destroyed by Xojo like a session close event or do I have to do something to tell Xojo to close the session?

Sorry, no. What you should do is redirect the user away from the app, either by sending them to a new URL or to Session.Header(“host”). The latter will start a new session, but at least the old session will receive the close event.

Personally, I like to use something like this:

ShowURL("http://www.mydomain.com/")

In that event to force the user away from the app so they’re not taking up valuable resources.

[quote=99544:@Greg O’Lone]Sorry, no. What you should do is redirect the user away from the app, either by sending them to a new URL or to Session.Header(“host”). The latter will start a new session, but at least the old session will receive the close event.

Personally, I like to use something like this:

ShowURL("http://www.mydomain.com/")

In that event to force the user away from the app so they’re not taking up valuable resources.[/quote]

I guess you put this in the session TimeOut event, and when the user is gone, the app shuts down ?

Thanks guys, that works perfectly and I can see the sessions go away when the user times out and is being redirected to the clients main site.

If I am using special url handlers do they create a session in Xojo? If they do then how do I kill them off at the end of the page that process them? Also is it possible to change the keep-alive header value to false for special urls so that I totally break the connection once the request has finished so that it doesnt consume resources?

HandleSpecialURL requests do not create sessions.