By default, Wisej displays the built-in timeout countdown window when session is about to expire. If a user clicks the OK button, it prolongs the session or
I might say that it resets the sessionTimeout and keeps the connection alive.
If I put a handler for Application.SessionTimeout event by showing a form with two buttons, one to Kill Session and one to Resume Session,
how would I code the Resume Session button to mimic the built-in timeout countdown window?
In multi-client app, Client A and Client B might have a different sessiontTimeout requirements. Is it possible to change the sessionTimeout value
at startup depending on user requirements? I have been looking in the documentation but can’t find any.
Lastly, does Wisej has a method to get/retrieve the value of the sessionTimeout stored in default.json file.
Your assistance would be highly appreciated.
The session timeout form needs only to kill the session. The OK button should simply close the dialog (you can have a non-modal showing the modal mask).
You can find all the configuration options, including custom options, in Application.Configuration. Application.Configuration.SessionTimeout is what you are looking for. Application.Configuration.Settings is a dynamic object where you can retrieve application specific settings from Default.json.
Changing SessionTimeout programmatically is difficult because it is sent back to the client before your code is called, in response to the init request. The client uses it to manage the timeout timer. Then the SessionManager sets the expiration timeout at SessionTimeout * 2 when adding the session to the cache.
You can have multiple .json files pointing to the same entry point and have different values: Client1.json, Client2.json, etc. All referring to the the same Main method. The URLs would be http://server/client1, http://server/client2.
Another option would be to add a custom cache provider in Web.config. It’s an easy implementation, the default is attached. To replace it add the full name of the type to an appSettings named “Wisej.CacheProvider”.
Please login first to submit.