14
Views
2
Comments
Sessionless service in OutSystems

Can someone please provide a little more context on this point in the OutSystems documentation (https://success.outsystems.com/documentation/best_practices/performance_and_monitoring/performance_best_practices_logic/) - how does one do this? Is this for only Traditional or also Reactive?

Nicholas,

Sessions are only used and managed by Tradweb.
https://success.outsystems.com/documentation/11/reference/outsystems_language/data/handling_data/session_variable/?_gl=1*1uq5gja*_ga*OTE2Nzg5OTEzLjE2OTI1NDY3NTY.*_ga_ZD4DTMHWR2*MTY5MzMyMTM1NC42LjEuMTY5MzMyMjI2MS42MC4wLjA.


Per the above documentation: "Session Variables are available only in Traditional Web Apps."


In OutSystems, you can manage sessions and their variables in several ways. Here's how you can optimize the performance by reducing the usage of session variables:

Use Local Variables Instead: Whenever possible, use local variables instead of session variables. Local variables are specific to a particular screen or action, and do not persist across different screens or requests.

Store Data in the Database: Instead of storing data in session variables, consider storing it in the database. For example, you could store filters or other temporary data in a database entity, keyed by the UserId, and then retrieve it whenever needed. This way, the data is only fetched for the pages where it is used, instead of being fetched in every request.

Use Input Parameters: For passing data between screens or actions, consider using input parameters instead of session variables. Input parameters are more efficient because they do not require storage in the session.

To remove the session altogether, you would need to avoid using any session variables in your application. OutSystems automatically manages the session and will create a new session for each user that accesses the application. If you do not use any session variables, the session will still be created, but it will not contain any data, which will help to optimize the performance.

It's important to note that completely removing the session might not be suitable for all applications, as it may result in loss of functionality or require significant changes to the application's logic. It's always recommended to carefully consider the trade-offs and test the application thoroughly after making such changes.

Thanks for the detailed answer!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.