RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSessionsService Class

TSessionsService stores end user data that is needed for a short period of time.

Pascal
TSessionsService = class(TCustomSessionsService);
C++
class TSessionsService : public TCustomSessionsService;

Add TSessionsService to a WebSnap application when you want to store temporary end user data in a WebSnap session. For example, TSessionsService can keep track of all users that are currently logged in and automatically log a user out after a period of inactivity. 

When a WebSnap application contains a TSessionsService component, each HTTP request is associated with a session. The WebSnap application can manage multiple sessions on behalf of different users, each on a separate thread of execution. When handling a request, only one session is available, which is called the current session. The current session is available as the Session property of the global Web context, which is accessed using the global WebContext function. 

TSessionsService stores session IDs and name/value pairs for all sessions in memory. This information must remain in memory between requests. Web application types that do not remain in memory between requests, such as CGI, do not support TSessionsService. When testing Web App Debugger executables, be sure to start the executables before browsing so that the executable remains running between requests. 

Use TEndUserSessionsAdapter and TSessionsAdapter together to keep track of end user name and login state. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!