This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
Session
|
Session -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | Object |
![]() |
Session object | |||||
The Session command returns the Session object corresponding to the current scalable user web session.
This command only works when scalable sessions are enabled (see ). It returns Null when sessions are disabled or when legacy sessions are used.
When scalable sessions are enabled, the Session object is available from any web processes in the following contexts:
The returned Session object has properties and functions that can be used to handle user sessions. They are detailed in the Session API section on developer.4d.com.
You have defined the action_Session project method with attribute "Available through 4D tags and URLs". You call the method by entering the following URL in your browser:
IP:port/4DACTION/action_Session
//action_Session method
Case of
:(Session#Null)
If(Session.hasPrivilege("WebAdmin")) //calling the hasPrivilege function
WEB SEND TEXT("4DACTION --> Session is WebAdmin")
Else
WEB SEND TEXT("4DACTION --> Session is not WebAdmin")
End if
Else
WEB SEND TEXT("4DACTION --> Session is null")
End case
Session API (developer.4d.com)
Web server user sessions (developer.4d.com)
Product: 4D
Theme: Web Server
Number:
1714
Created: 4D v18 R6
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)