Back to product page

SessionVars property

Returns collection of session variables.


WebSessions object


  • Basic
The SessionVars(object) syntax has these parts:
objectAn expression evaluating to an object of type WebUser


This property holds reference to collection of all session variables set for the user. When at least one session variable is set, wodWebServer will send cookie to the client on each response - waiting to find same same cookie sent back by the client on connections that follow.

When such cookie is found, wodWebServer will automatically return previously defined session variables through this property. Using session variables allows you do easily keep track of user's data during the session (session means more than one request/response).

Usual usage is to ask user for login/password once, put it in session variables and then use in each subsequent connection (as long as session doesn't expire). Contents of session variables are *never* sent to the client - they are only known on the server side, and always kept in memory only. Adding (and using) session variables is really easy - easy as
User.SessionVars("MyVar") = 5

or you can do something like this:
If User.SessionVars.Exists("MyCount") Then
 User.SessionVars("MyCount") = User.SessionVars("MyCount") + 1
 User.SessionVars("MyCount") = 1
End If

When no session variables for the user are defined, server does not send any cookies to the client.