Session Usage
What is Session?
- The concept of session is the storage of user information on the server side to create personalized content.
- Sessions exist between the opening and closing of the session.
- Session usage is specific to Forms in Synergy projects and can only be accessed by Forms.
- The sample output of Session used in the Synergy environment is as follows;
''json { "Instance": "consulting", "TokenId": "*", "Token": "*", "EncryptedData": "*", "Language": "en-US", "User": { "id": 13, "Name": "oselcuk", "InternalName": "oselcuk", "FirstName": "Şuayip Orhan", "LastName": "Seljuk", "Email": "oselcuk@bimser.com.tr", "CustomProperties": [], "Department": { "id": 7, "Name": "Consulting and Project Management Office Department", "CustomProperties": [] }, "Position": { "id": 11, "Name": "eBA-CSP Software Consultant", "CustomProperties": [] }, "Profession": { "id": 11, "Name": "Software Consultant" }, "Groups": [{ "Id": 1, "Name": "Bimser Eveyone Group" }, { "Id": 2, "Name": "Bimser Software Consultant Group" }, { "id": 3, "Name": "Bimser Consulting Development Group" }], "InternalId": 13 }, "HasDelegation": false, "DelegationId": 0 }
## Using Server-Side Session
- The command block that takes the first and last name of an example user is as follows;
''csharp
string firstName = Session.User.FirstName;
string lastName = Session.User.LastName;
string fullName = firstName + " " + lastName;
Using Client-Side Session
- The command block that takes the first and last name of an example user is as follows;
''typescript var firstName = this.session.User.FirstName; var lastName = this.session.User.LastName; var fullName = firstName + " " + lastName;