02-14-2022, 05:58 AM
(This post was last modified: 02-14-2022, 05:59 AM by Alexandre Machado.)
> I believe it creates a new session every time the link is refreshed
What link is that? A request for a file should not create a new session. Most files are served even without session validation. If this is happening, something is wrong with the links and/or the way they are being created/served.
> But UserSession object does not know its own session name/ID. Can I get it from WebAllpication or something?
UserSession knows it's IWApplication instance. You need o reference it via WebApplication. Each IWApplication instance is tied to a single user session (both logical and the actual UserSession object instance). E.g.
UserSession.WebApplication
> But all temp files are created in the root of the temp folders, not under user session subfolders
The cache system uses a common folder for all cache files regardless of the session. That's by design. You can set the cache folder for your application but you can't control how the files are saved inside it.
> What is the TIWServerController.SessionOptions.LockSessionTimeout for?
When IW is processing a request for a specific user session it will block other requests for the same session (don't confuse this with serializing requests for all other sessions). The LockSessionTimeout is the time it will wait for the first request to be completed, before rejecting the second request for *the same session*.
Example: Your user clicks on a button to generate a big report. It takes 3 or 4 minutes to generate it. Meanwhile, the same user gets impatient and decides to click on another button which triggers another action. This action will need to wait until the report is finished. The time it will wait is defined by this property. If the report finishes before the LockSessionTimeout expires, the second action will be executed. Otherwise, the user will receive an error message.
>Can I explicitly close my session, i.e.: on service stopping, so that it cleans up the temp files for me?
IW will do the proper clean-up of everything for you. When sessions are destroyed all files related to that session are deleted.
What link is that? A request for a file should not create a new session. Most files are served even without session validation. If this is happening, something is wrong with the links and/or the way they are being created/served.
> But UserSession object does not know its own session name/ID. Can I get it from WebAllpication or something?
UserSession knows it's IWApplication instance. You need o reference it via WebApplication. Each IWApplication instance is tied to a single user session (both logical and the actual UserSession object instance). E.g.
UserSession.WebApplication
> But all temp files are created in the root of the temp folders, not under user session subfolders
The cache system uses a common folder for all cache files regardless of the session. That's by design. You can set the cache folder for your application but you can't control how the files are saved inside it.
> What is the TIWServerController.SessionOptions.LockSessionTimeout for?
When IW is processing a request for a specific user session it will block other requests for the same session (don't confuse this with serializing requests for all other sessions). The LockSessionTimeout is the time it will wait for the first request to be completed, before rejecting the second request for *the same session*.
Example: Your user clicks on a button to generate a big report. It takes 3 or 4 minutes to generate it. Meanwhile, the same user gets impatient and decides to click on another button which triggers another action. This action will need to wait until the report is finished. The time it will wait is defined by this property. If the report finishes before the LockSessionTimeout expires, the second action will be executed. Otherwise, the user will receive an error message.
>Can I explicitly close my session, i.e.: on service stopping, so that it cleans up the temp files for me?
IW will do the proper clean-up of everything for you. When sessions are destroyed all files related to that session are deleted.

