Atozed Forums
Session timeout not working - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Session timeout not working (/thread-1669.html)

Pages: 1 2


Session timeout not working - martin.andersen@amesto.dk - 05-15-2020

Hey!
When I set the session timeout in a ISAPI project it doesn't work, in a standalone project it works as expected.
I am using 15.1.16.
I have tried setting it both from the object property in the IDE and from code: UserSession.WebApplication.SessionTimeOut := 1;
Doesn't anyone know if this is a bug or a misunderstanding from my side.
In standalone the session becomes invalid when press e.g. a button after timeout, and the timeout screen is shown, so I know what to expect.

I run without cookies because there was a problem with CORS when showing the form in a IFRAME on a web page in another domain, and I'll have to test if .22 have solved this problem maybe, but any upgrade could break a 100's of things so I wait even if .16 seems to be buggy in a few places.

Regadrs Martin


RE: Session timeout not working - kudzu - 05-15-2020

I'll let Alexandre handle the time out question but for CORS you need to enable it in the SC options.


RE: Session timeout not working - Alexandre Machado - 05-16-2020

Session timeout works correctly in ISAPI applications in latest version 15.1.22 regardless of your cookie settings.

I don't know exactly what you suspect that will break when upgrading but I don't think it is accurate.


RE: Session timeout not working - newuser - 05-18-2020

Hi there,
And in HTTP? (is there an explaination which for which application to use)

I have set the sessiontimeout to 1 and keep it alive with a trick I found:
http://www.yac.com.pl/mt.texts.iw-timeout.en.html
[url=http://www.yac.com.pl/mt.texts.iw-timeout.en.html][/url]
The sessions on which the browser is closed did last about 25 minutes.
And as it should be, the one with the browser running stays alive. 

How do I bring the 25 minutes back to 1 minute?


RE: Session timeout not working - kudzu - 05-22-2020

When you use that method, it basically pings the server. So long as it keeps pinging, it will never "timeout".

"and in HTTP?"

This makes no sense. Are you asking about http.sys?


RE: Session timeout not working - DanBarclay - 05-22-2020

I'm not sure what your situation is, but I'll quickly outline setting the values for form KeeplAlive and timeout:

1. Set the Session Timeout to whatever value you want. I believe default is 1 or 5 minutes (I don't remember, I explicitly set it). If there is no response from a form after that time, the session is flagged for destruction. The session technically still exists until IW does a scheduled cleanup and removes sessions that are "shut down". In your case, I think you want this set to 1 minute based on your comment.

2. IWForm.KeepAlive (NOT the IP Keepalive... this is on the IwFORM), set to true and it will automatically ping the server when that form is displayed, regardless of what the user is doing. This will keep the session from timing out. It will ping 3 or 4 times during the timeout period (that is, ping frequency is set by timeout). All of that is automatic.

With that setup, if a form is showing with KeepAlive set to true then the session will never time out. If you kill that browser window (form is shut down), the session will time out in based on the setting.

Exception: Some browsers (ex: Safari on iPhone) deactivate a form when it is not showing, even if the form is not closed. So, the session may time out if you bring up another app or even browser window. On a desktop, if the browser window exists it will continue to stay alive.

It shouldn't matter in this situation, but it is helpful if you can state your IW version and Delphi version along with the settings you have tried and the behavior you have seen.

Dan


RE: Session timeout not working - newuser - 05-23-2020

Hi Dan,
Thank you.
Using Delphi 10.3, Intraweb 15.1.21
LockSessionTimeOut 30000
RequiresExplicitStart=False
RestartExpiredVersion=true
SessionTimeOut=1
UniqueURL=false
When I call WebApplication.Terminate the session is terminated imediatly
When I close the browser without closing the application the session remaines about 25 minutes


RE: Session timeout not working - kudzu - 05-23-2020

Retest using the GuessISAPI demo.

Its possible that code you have added to your application is interfering with session shut down.


RE: Session timeout not working - newuser - 05-24-2020

Do you have a simple link for downloading the demo?


RE: Session timeout not working - kudzu - 05-24-2020

Guess I think may be part of the installation, if not look in our demo repository which is linked on our download page and I think there is a shortcut in the program group as well.