4D Blog

Home Product Enhanced Session Management for Development and Testing

Enhanced Session Management for Development and Testing

January 21, 2025

Product

With the latest 4D updates, we’ve extended the Session command to the Client/Server connection, enabling access to session storage at the Client level. Pairing this functionality with the new ‘Restrict’ event in ORDA classes makes filtering results based on session data—such as privileges, roles, or even geographic areas—easier than ever.

Developing an application in 4D meant working in a local environment, such as a single user. In standalone mode, the Session command always returned Null. This meant that you had to write complex code, checks whether the Session object was Null to read from “Storage” or “Session.storage”. This workaround, while functional, was not elegant.

With 4D 20 R8, this is no longer an issue. The Session command now returns a valid object, even in standalone mode, simplifying application development and testing.

Extended commands in standalone

With the notion of Session available in development, these 3 commands can now be used:

  • Session
  • Session info
  • Session storage

 

It’s important to note that the session created in a single-user environment is a simulated session. These commands should only be used to develop and test Client/Server applications to simplify your workflow.

In standalone applications, you continue to use the Storage command to retain user-specific information for use with the “Restrict” event, for example.

Practical use cases

Let’s explore some practical use cases for the session object, made simpler by the new feature introduced in this version of 4D.

Authentification

When authenticating a user with the “authentify” function, you can save information about the user within the Session object.

For further insights, check out these blogs:

  • Improved 4D Client Licenses Usage with Qodly Studio for 4D
  • Force Login Becomes Default for all REST Auth

 

Data restriction

With the “Restrict” event, you can protect your data depending on who accesses it and which data is accessed, and ensure data security by restricting access.

For more details, read this blog: ORDA – Restrict Data to Relevant Criteria

Shared data between sessions

Each session maintains its own storage. You can also access the storage of another session.

So the same user can access their storage from both the desktop client application, and the web application. Consequently, it’s very easy to start work on one device and continue on another, such as transitioning from your computer to a tablet, while keeping the same preferences.

To learn more, explore these blogs:

  • New 4D remote session object with Client/Server connection and Stored procedure
  • Enhanced Session Storage Access

Dive Deeper

If you want to learn more about all the different types of sessions, I recommend you read the pages on Web sessions, Remote sessions, API sessions, and Privilege sessions.

Don’t hesitate to share your experiences in the forum.

Discuss

Tags 20 R8, 21, Session

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy